
Mon, 03/18/2019 - 15:29
Forums:
Hello,
I'm a newbie with OCC. I want to ask you 1 question: How can I extract coordinates of all the vertices of a slot from a STEP file and input the result to a text file with name separately for each vertex (like vertex1 (3; 4; 5), vertex2 (1; 2; 3)?
I hope to receive your answers soon.
Tuan
Mon, 03/18/2019 - 17:57
Ciao
Giovanni
Mon, 03/18/2019 - 19:06
Hello Giovanni,
Thank you for your reply. It worked.
Can you help me with a problem about the normal vector?
I extracted the normal vector of all planes of Slot. But do you know how to calculate the cross and dot product between 2 normal vectors?
Tuan
Mon, 03/18/2019 - 21:37
Ciao
gp_Dir identifies a unit vector in space. Example for a dot product:
gp_Dir aDirection1;
gp_Dir aDirection2;
double val = aDirection1.Dot(aDirection2); //! scalar procuct
For a the vectorial product use the method gp_Dir::cross.
Several methods are available. See the documentation of package gp for further details.
Giovanni
Tue, 03/19/2019 - 15:39
Hello,
Thank you for your answer.
Do you know how to choose exactly the normal vector of 3 planes creating the slot (see in the step file)?
Any loop to find them quickly?
Tuan