remove shape

Tim Gao's picture

I want to remove a face from a shell,I used brepBuilder and reShape, but it didn't work.
Thanks,
Tian

abv's picture

Ask on the user's forum

Hello,

ReShape is the right tool to use, just remember that it gives you a new shape which is a copy of the original one with requested substitutions made.

Note that questions on OCCT usage (rather than development) are to be discussed on the user's forum, https://www.opencascade.com/forums

Andrey

Tim Gao's picture

Hi, Abv Thank you for your

Hi, Abv
Thank you for your reply.
But I don't know how can I replace to new shape.
Thanks,
Tian

TopExp_Explorer shellExplorer(partShape, TopAbs_SHELL);
for (; shellExplorer.More(); shellExplorer.Next())
{
TopoDS_Shape shellItem = shellExplorer.Current();
for (TopExp_Explorer faceExplorer(shellExplorer.Current(), TopAbs_FACE); faceExplorer.More(); faceExplorer.Next())
{
TopoDS_Shape faceItem = faceExplorer.Current();
BRepTools_ReShape re;
re.Remove(faceItem);
re.Replace(shellItem, re.Apply(shellItem));
re.Apply(shellItem);
}
}

OR
TopoDS_Shape faceItem = faceExplorer.Current();
BRepTools_ReShape re;
re.Remove(faceItem);
TopoDS_Shape newFace = re.Apply(shellItem);

BRepTools_Substitution substitution;
TopTools_ListOfShape lists;
lists.Append(newFace);
substitution.Substitute(shellItem, lists);
substitution.Build(shellItem);
substitution.Build(partShape);

www.opencascade.com

Copyright 2011-2017
OPEN CASCADE SAS
Contact us