Rounding
Moderators: remi77, jacs, Daniel
-
- Second Officer Cadet
- Posts: 209
- Joined: Wed Dec 30, 2015 11:25 am
- TopSolid Module: TopSolid'Wood
- TopSolid Version: 6.20
- Contact:
Rounding
Hello
Any idea whats wrong with roundings? Played several hours and no luck. I have several components like this, but direction is X or Y and they works fine. Rounding by Z don't work. Or I am too tired...
RM
Any idea whats wrong with roundings? Played several hours and no luck. I have several components like this, but direction is X or Y and they works fine. Rounding by Z don't work. Or I am too tired...
RM
- Attachments
-
- rounding.png (3.42 KiB) Viewed 2338 times
-
- Sergeant
- Posts: 68
- Joined: Thu Mar 25, 2021 4:39 pm
- TopSolid Module: TopSolid'Wood
- TopSolid Version: 6.23
- Location: Toulouse
- Contact:
Re: Rounding
Well, the value you have looks good to me ( 1 reading )
what value did you expect?
if you expect the closest real value do not put a 2 but a 1 in your round value > round2(n,1) you will get 7
if you place a 2 you will get 6 as 6 is closest to 8 when you have 6.9
what value did you expect?
if you expect the closest real value do not put a 2 but a 1 in your round value > round2(n,1) you will get 7
if you place a 2 you will get 6 as 6 is closest to 8 when you have 6.9
-
- Second Officer Cadet
- Posts: 209
- Joined: Wed Dec 30, 2015 11:25 am
- TopSolid Module: TopSolid'Wood
- TopSolid Version: 6.20
- Contact:
Re: Rounding
I like to get highest value, like on the sample in help file. Number 2 means to round it to next full upper value. This new pic have correct data, but when I play with Z value, then it forget that rounding in some cases.
RM
RM
- Attachments
-
- round2.png (3.84 KiB) Viewed 2326 times
-
- Sergeant
- Posts: 68
- Joined: Thu Mar 25, 2021 4:39 pm
- TopSolid Module: TopSolid'Wood
- TopSolid Version: 6.23
- Location: Toulouse
- Contact:
Re: Rounding
Try round2(n,1)
-
- Second Officer Cadet
- Posts: 209
- Joined: Wed Dec 30, 2015 11:25 am
- TopSolid Module: TopSolid'Wood
- TopSolid Version: 6.20
- Contact:
Re: Rounding
(n,1) rounding to lower full value, but I need higher. I will make a video, something strange in it.
-
- Second Officer Cadet
- Posts: 209
- Joined: Wed Dec 30, 2015 11:25 am
- TopSolid Module: TopSolid'Wood
- TopSolid Version: 6.20
- Contact:
Re: Rounding
Here is the video: http://www.tehnik.ee/round.mp4
Give priority to ends = Yes, but in some distances its going to red.
TSW 6.21, latest update (SP-10).
I have exactly the same expression for X-direction and it's working fine.
RM
Give priority to ends = Yes, but in some distances its going to red.
TSW 6.21, latest update (SP-10).
I have exactly the same expression for X-direction and it's working fine.
RM
-
- Sergeant
- Posts: 68
- Joined: Thu Mar 25, 2021 4:39 pm
- TopSolid Module: TopSolid'Wood
- TopSolid Version: 6.23
- Location: Toulouse
- Contact:
Re: Rounding
Hello
the part goes to red because of the trim tangent i guess to a plane of the part.
just to be sure you know there is 3 way to get values ( ROUND2 / CEIL2 / FLOOR2 )
if there is a problem it's not related to the specific X or Y or Z value it's a numerical issue.
i guess here the files are necessary with an explanation of the value you expect to have.
the part goes to red because of the trim tangent i guess to a plane of the part.
just to be sure you know there is 3 way to get values ( ROUND2 / CEIL2 / FLOOR2 )
if there is a problem it's not related to the specific X or Y or Z value it's a numerical issue.
i guess here the files are necessary with an explanation of the value you expect to have.
-
- Sergeant
- Posts: 68
- Joined: Thu Mar 25, 2021 4:39 pm
- TopSolid Module: TopSolid'Wood
- TopSolid Version: 6.23
- Location: Toulouse
- Contact:
Re: Rounding
Hi
not sure my answer is the one you expect, try this
when i change the values it looks good
not sure my answer is the one you expect, try this
when i change the values it looks good
-
- Second Officer Cadet
- Posts: 209
- Joined: Wed Dec 30, 2015 11:25 am
- TopSolid Module: TopSolid'Wood
- TopSolid Version: 6.20
- Contact:
Re: Rounding
This one looks good. Thx a lot!
- Laurens
- Sergeant
- Posts: 50
- Joined: Tue Apr 16, 2019 7:29 am
- TopSolid Module: TopSolid'Wood
- TopSolid Version: 6.24
Re: Rounding
judging from the replies you already have the answer but just to be clear:
ceil2(A,B) rounds off A to the next multiplication of B, so always up. ceil2(2.1,2) gives 4
round2(A,B) rounds off A to the closest multiplication of B, so either up or down. round2(2.1,2) gives 2 where round2(3.1,2) gives 4
floor2(A,B) rounds off A to the previous multiplication of B, so only down. floor2(2.1,2) gives 2
ceil2(A,B) rounds off A to the next multiplication of B, so always up. ceil2(2.1,2) gives 4
round2(A,B) rounds off A to the closest multiplication of B, so either up or down. round2(2.1,2) gives 2 where round2(3.1,2) gives 4
floor2(A,B) rounds off A to the previous multiplication of B, so only down. floor2(2.1,2) gives 2
Laurens
Team leader TSW draftsmen
De Klerk Binnenbouw
Team leader TSW draftsmen
De Klerk Binnenbouw
-
- Second Officer Cadet
- Posts: 209
- Joined: Wed Dec 30, 2015 11:25 am
- TopSolid Module: TopSolid'Wood
- TopSolid Version: 6.20
- Contact:
Re: Rounding
Yes, I got a point. Just finished 5+h tutorial videos serie and brain need some beers and sleep.
RM
RM