Inverse Transformation for projection
McGum
10/14/2021 6:13 AM


Hi,
Sorry for this "stupid" Question  but I'm searching for transformation who can do this:
https://stackoverflow.com/questions/2500499/howtoprojectaplanarpolygononaplanein3dspace
Is there a possibility to do this with CAD Lib default methods?
Thanks for your help,
Michael

Wout
10/14/2021 9:07 AM


There's no specific method in CadLib to create such a matrix, but you can create a Matrix4D yourself ofcourse using the values mentioned in the stackoverflow post.
 Wout

rammi
10/14/2021 10:05 AM


Hi Michael,
the solution on stackoverflow provides a transformation which is invertable in most cases, but if all you need is a oneway projection (i.e. something which projects 3D space to the plane's 2D space) things are much easier and CadLib can do a lot to help.
In that case the requirement that all points of the polygon are planar is nolonger necessary, and all we need is a transformation which projects any point to the plane. That may look hard enough at first glance, but let's think of a simple case: how would you project a 3D point to the XY plane? Indeed, just discard the Z coordinate.
With that in mind a solution to the problem can be done in 3 steps:
C# Code: / 
McGum
10/14/2021 10:51 AM


Thanks Rami,
will try this!
