There will always be a deviation in the Z-value of the coordinates of the riser

There will always be a deviation in the Z-value of the coordinates of the riser

1039574776
Enthusiast Enthusiast
255 Views
2 Replies
Message 1 of 3

There will always be a deviation in the Z-value of the coordinates of the riser

1039574776
Enthusiast
Enthusiast

When arranging the conduit, the Z value in the last point XYZ of the riser is set correctly. For example, the last point of the riser was originally set to (44.693623167, -17.191586493, 5.905511811), but after the line pipe was arranged by program, the last point of the riser became (44.693623167, -17.191586493, 4.46522309711286), resulting in the Z value of the riser always being deviated, and it was tested many times, and the result was the same. Who has ever encountered such a situation, and how to solve this deviation problem? See points 1 and 2 in the screenshot for details.picture20231218.jpg

0 Likes
256 Views
2 Replies
Replies (2)
Message 2 of 3

jeremy_tammik
Alumni
Alumni

Yes. It is very important for every programmer dealing with geometry and CAD to understand that it is impossible to exactly represent a floating point number in a digital computer. Hence, the need for fuzz when comparing two numbers:

  

 

To avoid any deviation in a series P1, P2, ... Pn of vertical points, you can proceed as follows. Pick one of the collinear vertical points. It does not matter which one it is, and any one will do, e.g., the bottom one. Let's assume that is P1 with coordinates (x1,y1,z1). Now, replace the entire series of points P1,...Pn by a modified series P1,Q2,Q3,...Qn by defining each Q as follows:

  

  Qi = (x1,y1,zi) for i = 2, 3, ... n

 

In other words, define all the Q so that they lie exactly vertically above P1.

   

Since the Pi are all supposed to be vertical, the difference between their x and y coordinates must be negligeable.

  

So, ignore it, and Bob's your uncle. Good luck.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 3

1039574776
Enthusiast
Enthusiast

I'm wondering if this has something to do with snapping. For example, in CAD programming and development, if you want to automatically draw drawings in the model or layout, you will basically turn off the snapping settings, and then restore the initial settings after completion, otherwise, because the snapping is on, there are many insertion points, breakpoints, end points, etc. Drift happens, which is bad. Is this also the case taken into account in Revit development?

0 Likes