I have a line, defined with origin and direction. How is it possible to turn this line through a given angle?
Is there a special class for this purpose?
Thanks in advance
Markus
Tilman Leune Fri, 01/22/2010 - 16:57
hi,
you should take a look at gp_Trsf.
This is the foundation class for Transformations
an example of usage is shown in the Bottle Tutorial
Fri, 01/22/2010 - 16:57
hi,
you should take a look at gp_Trsf.
This is the foundation class for Transformations
an example of usage is shown in the Bottle Tutorial
Fri, 01/22/2010 - 20:05
Got it. Thanks for the hint.
// build a line
gp_Pnt initPoint(0.00, 0.00, 0.00);
gp_Pnt endPoint(0.00, 0.00, 1.00);
BRepBuilderAPI_MakeEdge edge1(initPoint, endPoint);
builder.Add(compound, edge1);
TopoDS_Shape lineShape(compound);
// rotate line
gp_Trsf myTrsf;
myTrsf.SetRotation(gp::OX(), alpha * (PI /180) );
BRepBuilderAPI_Transform xform(lineShape, myTrsf);
lineShape = xform.Shape();