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

Extruding wires, Split solids by surfaces and collecting objects

Philipp Derevenets's picture
Forums: 

Good day!
Please help me to understand:
1. How in Open Cascade create surface by extruding edge or wire?
2. How to cut (split) the solid into parts with the help of the surface from issue 1?
3. Is there a collection of objects, which can be combined resulting objects without turning them into compound (to return a list as a result of the function)?
I apologize for the simple questions, but working with Open Cascade for me is very new and the unknown (as well as programming in C ++ in general - I program in Pascal in Delphi).
I attach a picture with my task.

Attachments: 
Forum supervisor's picture

Dear Philipp,
We have an extensive experience in developing 3D modeling functionality. We can discuss all your problems and propose a solution acceptable for you. Please contact us via http://www.opencascade.org/about/contacts/ if you will decide to use our support services.
Training and e-learning courses are also at your disposal - http://www.opencascade.org/support/training/.
Best regards
FSR

Alexander Luger's picture

Hello Philipp!

1) See class BRepPrimAPI_MakePrism
2) To cut a solid by a face you can use the class BRepAlgoAPI_Cut

Regards,
Alex

Philipp Derevenets's picture

Hello Alexander!

On question 2, please give an example. My code generates an error:

TopoDS_Shape aShape1;
TopoDS_Shape aShape2;
BRepAlgoAPI_Cut tmpCutter(tmpVolume_1, tmpShell_1_1);
tmpCutter.Build();

if (tmpCutter.IsDone()) aShape1 = tmpCutter.Shape();
aShape2 = tmpShell_1_1;

Best regards,
Philipp

Alexander Luger's picture

BRepAlgoAPI_Cut works well if both inputs are volumes. Try:

BRep_Builder B;
TopoDS_Solid aSolid;
B.MakeSolid(aSolid);
B.Add(tmpShell_1_1));
BRepAlgoAPI_Cut tmpCutter(tmpVolume_1, aSolid);
...

Regards,
Alex

Alexander Luger's picture

Sorry, this is the correct line:

B.Add(aSolid,tmpShell_1_1));

Philipp Derevenets's picture

Thank you! The function is work. Explain only please: In order to be a function is worked I must to create a solid. But this is a kind of solid temporary body, a stub for the function? Maybe then it is better to use functions BRepFeat_SplitShape?

Philipp Derevenets's picture

Another very important question: how I can to find solid parts required position in space? For example, among the parts I need to find the solid with the faces (or edge, or vertices) with coordinates lie in the required range.

Philipp Derevenets's picture

The fact of the matter is that I need both parts of cut solid and the function returns only one. Cutting surface is a temporary, after cutting, it is no longer needed.

Alexander Luger's picture

See this thread http://www.opencascade.org/org/forum/thread_18146/?forum=3

Philipp Derevenets's picture

Thank you very much!
I have a polučis′ cut the solid parts. As far as I understood, the method BOPAlgo_Builder is a very common procedure. It allows allows you to divide all objects at their intersections. Am I right?

Here is the code I have is:

TopoDS_Compound cmdExtractShapes(const TopoDS_Shape varSource, TopAbs_ShapeEnum varShapeKind)
{
TopoDS_Compound tmpResult;
BRep_Builder tmpBuilder;

tmpBuilder.MakeCompound(tmpResult);
TopExp_Explorer tmpExplorer(varSource, varShapeKind);
for (; tmpExplorer.More(); tmpExplorer.Next())
{
const TopoDS_Shape& tmpItem = tmpExplorer.Current();
tmpBuilder.Add(tmpResult, tmpItem);
};

return tmpResult;
};

TopoDS_Shape cmdSplitVolumeByShell(TopoDS_Shape varVolume, TopoDS_Shape varSeparatorShell)
{
BOPAlgo_Builder tmpBuilder;

tmpBuilder.AddArgument(varVolume);
tmpBuilder.AddArgument(varSeparatorShell);
tmpBuilder.Perform();

TopoDS_Shape tmpResult = tmpBuilder.Shape();
tmpResult = cmdExtractShapes(tmpResult, TopAbs_SOLID);

return tmpResult;
};

Philipp Derevenets's picture

Another very important question: how I can to find solid parts required position in space? For example, among the parts I need to find the solid with the faces (or edge, or vertices) with coordinates lie in the required range.

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.