DiscussionsIssue archiveOCCT:Modeling Algorithms

Archived issue #0004216

Problem with TopoDS_Shape.Moved(gp_Trsf trs)

CommunityOCCT:Modeling Algorithmsclosed0 public notes

Search issues

Description

Bug from Open CASCADE Community

Registered by Lee Sangsu.

http://www.opencascade.org/forumorg/bug.php?bug_id=149

TopoDS_Shape.Moved(gp_Trsf trs) works wrong when the trsf is made from mirror by
vertex or plane.

Try the following which was from the TopologyTransformation MFC Sample.
>>> //TopoDS_Shape S2 = S.Moved(theTransformation); //BUG!!!

when you try the above code, the result will be invalid shape which are shaded
wrong and its volume is negative.
and the BRepBuilderAPI_Transform deals with this case properly. but I think it
should work through TopoDS_Shape::Moved... , for it is more simple and is much
used in many source code now.


void CTopologyTransformationsDoc::OnMirror()
{
AIS_ListOfInteractive aList;
myAISContext->DisplayedObjects(aList);
AIS_ListIteratorOfListOfInteractive aListIterator;
for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){
myAISContext->Remove(aListIterator.Value());
}
TopoDS_Shape S = BRepPrimAPI_MakeWedge(60.,100.,80.,20.);
Handle(AIS_Shape) ais1 = new AIS_Shape(S);
myAISContext->SetColor(ais1,Quantity_NOC_GREEN,Standard_False);
myAISContext->SetMaterial(ais1,Graphic3d_NOM_PLASTIC,Standard_False);
myAISContext->Display(ais1,Standard_False);
gp_Trsf theTransformation;
gp_Pnt PntCenterOfTheTransformation(110,60,60);
Handle(AIS_Point) aispnt = new AIS_Point(new
Geom_CartesianPoint(PntCenterOfTheTransformation));
myAISContext->Display(aispnt,Standard_False);
theTransformation.SetMirror(PntCenterOfTheTransformation);
BRepBuilderAPI_Transform myBRepTransformation(S,theTransformation);

>>> TopoDS_Shape S2 = myBRepTransformation.Shape();//This works well

>>> //TopoDS_Shape S2 = S.Moved(theTransformation); //BUG!!!

Handle(AIS_Shape) ais2 = new AIS_Shape(S2);
myAISContext->SetColor(ais2,Quantity_NOC_BLUE1,Standard_False);
myAISContext->SetMaterial(ais2,Graphic3d_NOM_PLASTIC,Standard_False);
myAISContext->Display(ais2,Standard_False);
Fit();
}

Remarks : RLN

Though Sangsu Lee is our support client and we are not expected to fix his bugs
for free, this report may reveal some fundamental problem.
So, may I kindly request you to:
- make sure that documentation does/does not describe this limitation
- make sure it is/is not a bug (as I can guess it's not - but rather limitation
- because Moved() must be and is a fast function without any computations)
- if it is a limitation (i.e. Moved() should accept transformations only without
mirroring) then to document this limitation - this will be the official answer
for this bug
- correct the bug in MFC sample (replacing by BRepBuilderAPI_Transform, if
Moved() is not expected to be corrected)
- inform SZV on the status

The priority is low for this task. Preparing 5.1.1 is a top notch today.

Public activity

No public notes

Participants are labeled by their role within this record.