Dear All,
I have shape with not having the edges orthogonally, I need to rectify those shapes with the edges orthogonally (exactly 90 degree) by programming.
Can anyone share me with logic
Thanks in advance
Regards,
K.Jayakumar
Hai,
The file is 3D. Here with I am attaching the DGN for your reference, you can able to see the include angle not exactly 90degree. I need to change all the edges to be exactly 90 degree.
Well, your example is even worse I expected: Vertices of the shape are not in the same plane (in other words the shape is not 2D but 3D element).
At first you have to define the rule how the shapes will be orthogonalized. I think it's more important than the code itself.
E.g. it can be done such way that lengths between vertices will remain the same (except the last one). And what about Z axis? Should be the same (shapes are parallel to XY-plane) or first 3 points define the plane or something else?
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
In a 2D model, all shapes are planar. In that case it is feasible to rectify a quadrilateral by adjusting its vertices so that the shape becomes a rectangle. However, as Jan advises, you must define the rules of rectification: do you want sides to remain the same length, or do you want some vertices to remain unchanged?
In a 3D model a shape may be planar or non-planar. A planar shape has all vertices on the same plane (it is a 2D element rotated to that plane); a non-planar shape is a 3D object. If a shape is non-planar then it is hard to understand what you mean by 'orthogonal'.
Regards, Jon Summers LA Solutions
Thanks Jon, better explanation than mine :-)
Thanks Jon for your reply,
My question is very simple I want to rectify that shape that all the edges should be exactly 90 degress. You download the dgn and check with angle measurement tool you can able to see it is not 90degree, it is around 91.5 , 89.7 .
It is not necessary to maintain same length
Hi,
your question is of course simple, but the topic itself is quite complex.
If you have no special requirements, I can imagine 1st and 2nd point of the shape will remain the same and the rest of vertices will move to correct the angels. Other shape parameters (circumference, area, length of sides) will change also.
But in your example file the shape is not planar (one vertex is "out" from others) and as Jon explained, in such case the requirement for othogonality is not clear and has to be described in more detail. If the shape is not planar, how angles should be measured - real 3D angles, projected angles to XY-plane or to a plane defined somehow?
Hi
There is no issue of maintaining same area,length of sides etc. Again I am sending you the sample dgn, element in level "notorthogonal" is to be converted to same as available in element in "orthogonal" level.
Hope you can understand.
You have changed your requirements ... or you missed an important information in your first question: From the new example it's apparent you want to flatten (make plannar) AND orthogonalize the shapes, which is different (and fortunately more simple) game.
Should be shapes parallel with XY plane, so all vertices will have the same Z coordinate) or the shapes can be in general position? It was (again) not defined and is important and is NOT visible from your example, because only one shape (original + corrected) is in your example file.
Yes all vertices will have the same Z coordinate
Yes the shapes can be in general position
You answered Yes to both questions, which makes no sense, it is A or B, not A and B. So again:
(B) option is of course more complex, because in such case you have to define the rule how the plane, that should be used to flatten the shape, will be defined. It can be e.g. 1st, 2nd and 3rd point of the shape.
Thanks Jan and Jon I have solve the issue on my own.
Unknown said:I have solve the issue on my own
Excellent!
And what is your solution? It's good practise to include the answer to a question posted on these Forums. That way, everyone benefits.