For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

Create FACE or SURFACE from EDGES (or Curves)

Macedo's picture
Forums: 

Hi,

I create some curves manually and then EDGES from these curves (attached image). As you can see there's no way to create a plane using them. So, my question is, how can I build a FACE from those curves?
I know all curves should have PCurves. But, in order to create PCurves it's necessary to have at least the Surface. I tried to create some Surface using GeomFill_Generator, but with no success.
Could someone help?

Thank you in Advance
Regards

Attachments: 
Gerrit Bette's picture

You need one intermidiate step: Wires.

Once you have added your four curves to a Wire, it should be possible to create the face from this with BRepBuilderAPI_MakeFace.

To connect your edges to a wire, add them manually (compare bottle turorial)

BRepBuilerAPI_MakeWire wireMaker();

for(i = 0; i {
wireMaker.Add(myEdges[i]);
}

TopoDS_Wire myWire = wireMaker.Wire();

This wire can now be used as a parameter to BrepBuilderAPI_MakeFace and should be resulting in your face being generated.

Göran Barz's picture

BrepBuilderAPI_MakeFace only deals with planar wires, if the wire is not planar (like in his example) BrepBuilderAPI_MakeFace also needs a surface.

Gerrit Bette's picture

This is untrue. From there is a special function parameter to limit Makeface to planes:

Quote from documentation:

Standard_EXPORT BRepBuilderAPI_MakeFace (const TopoDS_Wire &W, const Standard_Boolean OnlyPlane=Standard_False)
Find a surface from the wire and make a face.
if is true, the computed surface will be
a plane. If it is not possible to find a plane, the
flag NotDone will be set.
.

Göran Barz's picture

I always get the error BRepBuilderAPI_NotPlanar, no matter if I pass Standard_True or Standard_False

Gerrit Bette's picture

Oh, sorry.

I haven't tried it, just quoted from the manual.

Seems to be that the Documentation is incorrect or incomplete.

No offense intended.

Göran Barz's picture

Did you already try BRepFilling? have a look at my sample code in http://www.opencascade.org/org/forum/thread_18933/

Macedo's picture

Hi Göran Barz,

I've already tried. But with no success. Maybe I used in a wrong way.
Do you have success using this class?

Thank you in Advance
Regards,

Göran Barz's picture

It works in simple cases for me, but if you have too many edges or too complex structures, an Exception (e. g. out of memory) is thrown

Macedo's picture

I have the same problem. Did anybody try to create a surface using EDGEs(or Curves)?

Roman Lygin's picture

http://opencascade.blogspot.com/2010/03/surface-modeling-part6.html

Check the code in the example 'Plate' (on Windows) for the Hole filling scenario. It should guide what it takes to build an entire face. Also you might want to check the BRepTest_FillingCommands.cxx for other examples.

I remember the Plate algorithm had issues with cases of semi-cylinder-like surfaces (which seems to be your case on the screenshot). It created some too curved surface (not like soap-bubble). You might want to experiment with parameters fed into the Plate algorithm.

Hope this helps.
Roman

Macedo's picture

Thank you VERY much Roman!

It work, finally! I used GeomPlate_BuildPlateSurface, and added the Curves from my EDGES. It worked as I expected! ;-)

Volodymyr vvv's picture

Hi. I also interested how to create surface from edge. But I'm new in opencascade , can you give some example how to create surfece from edge?

Volodymyr vvv's picture

Hi. Can you explain or show how you get from edges Adaptor3d_HCurveOnSurface?
 

shantanu kumar das's picture

Dear Sir,

can you tell me how to make a surface from non-planar wire using GeomPlate_BuildPlateSurface?

Anton Shabalin's picture

Hello, everyone!

To make Face from edges (see pic. on the first message), one should do the following.

1) Make infinite surface from arc edge (you can use BRepPrimAPI_MakePrism(arcEdge, Direction)

2) Calculate PCurves for each edge, using the function called PutPCurve( const TopoDS_Edge& e, const TopoDS_Face& f). It could be found in LocOpe_WiresOnShape.cxx. (see attached file)

3) Make a wire from edges (BRepBuilerAPI_MakeWire)

4) Make face, using infinite surface and wire (BRepBuilderAPI_MakeFace)

Attachments: 

Contact us

Attention: DO NOT use this form for all kind of request for the removal of your personal data. Please follow this link for such cases.