Create face from non-planar wire (using OCGC_MakeArcOfCircle and straight lines)

Hello guys,

I just finally understood why BRepBuilderAPI_MakeFace wasn't working and that's because it only works with plannar edges.
I would like to make a face created via two arcs and straight lines connecting these arcs. Is this possible? Thanks A LOT in advance! I attached an image to demonstrate what I mean.

Cheers,
Bernardo

Attachments: 
bcarneiro's picture

And here is what I tried (BRepFill_Filling) but it crashes for me

BRepFill_Filling makeFilling(3, 15, 2, false, 0.00001, 0.0001, 0.01, 0.1, 8, 9);
foreach (OCTopoDS_Edge edge in OCCEdges)
{
makeFilling.Add(edge, OCGeomAbs_Shape.GeomAbs_C0, true);
}
makeFilling.Build(); // Crashes here

Gabriel Bauer's picture

Hi Bernardo,

take a look in this topic:

http://www.opencascade.org/org/forum/thread_18969/

I think it would help.

Regards,
Gabriel

bcarneiro's picture

Hi Gabriel,

thanks for the link. I did try that solution but I couldn't get it work. When I use GeomPlate_BuildPlateSurface I'm supposed to supply the Add function with a GeomPlate_CurveConstraint, which I didn't understand how to convert to that from an edge.

Macedo said
"It work, finally! I used GeomPlate_BuildPlateSurface, and added the Curves from my EDGES."
do you know how he did that from the edges?

Thanks in advance!
Bernardo

Gabriel Bauer's picture

I think you can do it like this:

Handle(Geom_Curve) curve = BRep_Tool::Curve( edge, f, l );
GeomAdaptor_Curve adaptCurve( curve, f, l );
Handle(GeomAdaptor_HCurve) adaptHCurve = new GeomAdaptor_HCurve( adaptCurve );
Handle(GeomPlate_CurveConstraint) curveConstraint = new GeomPlate_CurveConstraint( adaptHCurve, 0 );

bcarneiro's picture

Hey Gabriel,

thanks a lot for your kind help! However I still couldn't get it work because the C# wrappers I'm using doesn't have some of the needed classes. Would you be kind enough to help me with BRepFill_Filling? I have added the edges, which makes a closed-shape to BRepFill_Filling and then called Build(), but it crashes. Am I missing something? Thank you in advance!

BRepFill_Filling makeFilling(3, 15, 2, false, 0.00001, 0.0001, 0.01, 0.1, 8, 9);
foreach (OCTopoDS_Edge edge in OCCEdges)
{
makeFilling.Add(edge, OCGeomAbs_Shape.GeomAbs_C0, true);
}
makeFilling.Build(); // Crashes here

Cheers,
Bernardo

bcarneiro's picture

ugh!! sorry, it was such a dumb mistake, the code above is correct and works perfectly! thanks

shantanu kumar das's picture

Dear Sir;

I implemented the below code but it crashes in the line makeFilling.Build();

What is the reason for it? how can we resolve it?

BRepFill_Filling makeFilling(3, 15, 2, false, 0.00001, 0.0001, 0.01, 0.1, 8, 9);
foreach (OCTopoDS_Edge edge in OCCEdges)
{
makeFilling.Add(edge, OCGeomAbs_Shape.GeomAbs_C0, true);
}
makeFilling.Build(); // Crashes here