cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Transform Point from Section CS into Solid(World) CS

SOLVED
Level 1

Transform Point from Section CS into Solid(World) CS

Hey,

I have a Section with a line with starting point (0,0). Now I want to get world coordinates(in the Solid CS) for this line. It may be like (100, 140, 10)

I read in the User Guide, that there is an option to transform coordinates using rotation matrix(and probably not only rotation but also shifting as long as Matrix is 4x4).

Say I have an object of pfcTransform3D class, now I have to setMatrix and then I will be able to TransformPoint

The question is: To setMatrix, I have to know coordinate system's base vectors (for xOy are (1, 0) and (0,1)) for both (target and source CS's). Where can I get these vectors for my Section and Solid (probably (1, 0, 0) and (0, 1, 0) and  (0, 0, 1) )  and Shifting vector?

Thank you in advance,

Artem

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Transform Point from Section CS into Solid(World) CS

OK guys,

I think, I managed this.

wfcSection_ptr class has member GetLocation(), which returns pfcMatrix3D_ptr.

pfcTransform3D constructor arguments are: bool, pfcMatrix3D_ptr.

So final code should be close to:

  pfcTransform3D trans(true, section->GetLocation());

  pfcPoint3D_ptr point = pfcPoint3D::create();

  point->set(0, 0);

  point->set(1, 100);

  point->set(2, 0);

  pfcPoint3D_ptr point_new = trans.TransformPoint(point);


It seems, that is what I need.

1 REPLY 1
Highlighted

Re: Transform Point from Section CS into Solid(World) CS

OK guys,

I think, I managed this.

wfcSection_ptr class has member GetLocation(), which returns pfcMatrix3D_ptr.

pfcTransform3D constructor arguments are: bool, pfcMatrix3D_ptr.

So final code should be close to:

  pfcTransform3D trans(true, section->GetLocation());

  pfcPoint3D_ptr point = pfcPoint3D::create();

  point->set(0, 0);

  point->set(1, 100);

  point->set(2, 0);

  pfcPoint3D_ptr point_new = trans.TransformPoint(point);


It seems, that is what I need.