Tue, 01/13/2004 - 12:53
Hello to all,
I have quite a strange problem with OCC:
When applying transformations (rotation/translation) on a Cylinder/Cone etc using the BRepPrimAPI_MakeCone etc classes, the surfaces received from those classes just vanish or become transparent.
Ommitting any transformation results in everything working out fine !
Here is a code-example:
BRep_Builder myBuild;
myBuild.MakeCompound( allBladesHubSurfCompound);
BRepPrimAPI_MakeCone myNabCone( axis, (Standard_Real) (0.5 * H * HubDiameterRatio), (Standard_Real) (0.5 * 0.01 * H * HubDiameterRatio), (Standard_Real) (HubLen * HubLenFACTOR * 3.0));
TopoDS_Shape myShapeNabCone = myNabCone.Shape();
// translate cone along "axis"
gp_GTrsf coneTrafo;
coneTrafo.SetTranslationPart( gp_XYZ( delX, 0.0, 0.0));
BRepBuilderAPI_GTransform myConeTrafo( myShapeNabCone, coneTrafo, Standard_True);
TopoDS_Shape myShapeNabCone = myConeTrafo.Shape();
myBuild.Add( allBladesHubSurfCompound, myShapeNabCone);
What is wrong ? Shall I use Geom_Cone ? But I need a TopoDS_Shape object to add this to the container (compound).
Any hints are welcome
Best Regards.
MCV
Wed, 01/14/2004 - 11:37
Hi !
I guess you are sure you don't transform it so that it ends up outside the view volume ?
If you for example change the translation to 0.0, 0.0, 0.0, does it still vanish ?
Mikael
Wed, 01/14/2004 - 17:05
Yes it vanishes too, no matter what the input is.
By the way, this error occurs in the OCC-qt viewer delivered with the distribution.
MCV
Thu, 01/15/2004 - 12:33
hello
I have tested the following code:aContext= Mecanisme::GetAISContext();
BRepPrimAPI_MakeCone myNabCone( 10,20,50);
TopoDS_Shape myShapeNabCone = myNabCone.Shape();
Handle(AIS_Shape) aShape1 = new AIS_Shape(myShapeNabCone);
aContext->Display(aShape1, Standard_False);
// translate cone along "axis"
gp_GTrsf coneTrafo;
coneTrafo.SetTranslationPart( gp_XYZ( 50, 0, 0));
BRepBuilderAPI_GTransform myConeTrafo( myShapeNabCone, coneTrafo, Standard_True);
TopoDS_Shape myShapeConeTrafo = myConeTrafo.Shape();
Handle(AIS_Shape) aShape2 = new AIS_Shape(myShapeConeTrafo);
aContext->Display(aShape2, Standard_False);
Shape1 and Shape2 are displayed fine.
In your Code sample the two TopoDS-Shape have the same name TopoDS_Shape myShapeNabCone???
I hope this will help you.
I work with OCC5.1
Sat, 01/17/2004 - 20:00
Thank you for your tip, I checked this out an it still did not work.
Could it be an OCC-problem with the BRep-classes ???
It works fine with BSplineCurves when putting them altogether into a Compound and transform this compound.
Quite clueless, best regards
MCV
Sat, 01/17/2004 - 20:01
Thank you for your tip, I checked this out an it still did not work.
Could it be an OCC-problem with the BRep-classes ???
It works fine with BSplineCurves when putting them altogether into a Compound and transform this compound.
Quite clueless, best regards
MCV