Thu, 08/06/2020 - 12:25
Hi,
I have a non planar closed wire (made from an arbitrary number of 3D NURBS) and a shape made of faces (that I can sew and use to make a shell), the wire lies on this shape. I want to fill this wire (resulting in a shape made of one or more faces).
I tried to use only the wire by:
* Using BRepBuilderAPI_MakeFace but the wire is not planar.
* Building a surface with GeomPlate_MakeApprox and using BRepBuilderAPI_MakeFace with this surface without success.
* Filling the wire using GeomPlate_BuildPlateSurface and BRepFill_CurveConstraint without success.
* Filling the wire using BRepOffsetAPI_MakeFilling with some success depending on the wire.
I am now trying to use the faces. I am trying two approaches: get the shapes within the wire or cut the shell with the wire. I did not yet succeed, I am not sure I am using the right functions for this.
Could you guide me with the method / functions to use to solve my problem?
Thanks in advance!
Regards
PS: I forgot to mention, I am using version 6.9.1
Thu, 08/06/2020 - 16:31
I have successfully "drawn" the wire on the shell with BOPAlgo_Builder but now I do not know how to get the faces "inside" the wire.
Fri, 08/07/2020 - 18:33
I have tried the following method:
* extrude the wire into a prism with BRepPrimAPI_MakePrism
* make it solid with BRepPrimAPI_MakeHalfSpace
* make a shell with the faces of my underlying shape
* use BRepAlgo_Cut to cut the prism from the shell
But the cut does not seem to cut all around the prism.
See attached image:
1. the wire
2. the shape and the wire together
3. the result of the cut
Mon, 08/10/2020 - 12:43
I am able to cut the prism from my previous comment in a plane. Any idea why it does not work correctly in the shell?
Fri, 08/14/2020 - 18:56
I also try with BRepAlgoAPI_Cut/Common but results vary with the shape of the wire and with the length and orientation of the prism made from the wire. I do not understand what conditions need to be fulfilled for those algorithms to work.
Sat, 08/15/2020 - 16:05
I don't think extruding the wire and boolean operation is the way to go. After the BOPAlgo_Builder operation I would try:
Feed the 2 image shells into bounding box algo and keep the smaller shell.
or
using
ShapeAnalysis_FreeBounds on
the 2 image shells, 1 shell(the inner) should have 1 closed wire and the other(the outer) should have 2 closed wires. This assumes that the trimming wire doesn't intersect the original shell's outer wire.or
in my gui application, I store the user pick location on the original shell. Then post BOPAlgo_Builder operation, I classify the original pick point on the 2 image shells and keep the shell containing the point.
Sat, 08/15/2020 - 19:32
Hi Thomas Anderson, thank you for you reply.
How can I get the two image shells you are talking about?
Here is what I have:
Sat, 08/15/2020 - 23:13
Yes, sorry. I forgot that BOPAlgo_Builder doesn't split apart wires and shells in the result images. This is starting to come back to me. You will have to write a face walking algo that doesn't cross the trimming edges. I am confused that your 1 shell result has 2 closed boundaries. Doing a similar operation here, I get 1 shell result with 1 closed boundary. Maybe you have some bad geometry?
Mon, 08/17/2020 - 16:20
Actually yes, the sewing operation apparently failed to sew two faces and an inner wire seems to have been created (it can be seen in the screenshots, there is a green line in the middle of the shell).
How can I get the trimming edges generated by BOPAlgo_Builder? I don't understand what is in .images() and .splits().
Tue, 08/18/2020 - 20:13
You have to be careful with sew. It is very liberal in what is acceptable output. Maybe you need to increase the tolerance to get expected results. BOPAlgo_Builder::splits has been removed in occt 7.3 so you probably shouldn't code much around that. TopTools_DataMapOfShapeListOfShape maps a single shape to a list of shapes. so, 'images' maps a single input shape to a list of output shapes and 'origins' maps a single output shape to a list of input shapes. Here is a code clip that dumps out images in a custom program:
Why don't you post the shapes instead of me guessing what you have from a picture. I am on occt 7.4 so our results might differ.
Wed, 08/19/2020 - 17:57
Thanks a lot, I managed to find the section wire and test the faces attached to it.