Notifications
Clear all

[Closed] script for approximate the coordinates

Hello, guys!
I looking for a script for approximate the coordinates. It should always be zero after a comma (integer).
You can see how it should look like in the picture. Thanks.

3 Replies

(
    fn RoundObjectPos node =
    (
        p = node.pos
        node.pos = [int p.x, int p.y, int p.z]
    )

    RoundObjectPos $
)

or


$.pos = [int $.pos.x, int $.pos.y, int $.pos.z]

Hi!
Thanx. I found this solution:

for selObjs in selection do (
selObjs.pos.x = floor(selObjs.pos.x + 0.5)
selObjs.pos.y = floor(selObjs.pos.y + 0.5)
selObjs.pos.z = floor(selObjs.pos.z + 0.5)
)

1 Reply
(@polytools3d)
Joined: 1 year ago

Posts: 0

That won’t give you the results you showed in the sample image. But if it works for what you need, good for you.

For instance, in your example you have:


[-15.42, -31.649, 1.774] -> [-15, -31, 1]

With the code you found you get:


[-15, -32, 2]