Divide by distance in Circular Surface Bug

Hello Everyone,

I am trying to divide circular surface by distance but for some reason it gives me many lines inside circle and also shows warning: One of the distance divisions failed on the first attempt. Entire sequence aborted.

But it works fine in Rectangle Surface:

Thanks in Advance!

Divide_distance_in_CircularSrf.gh (8.0 KB)

The circular Srf has only one edge…

1 Like

Hi @dowazura

Thanks a lot!

How to make all points distance equally divided, may be i need to shift all to center.

And also how can i remove points not equally to distance (3).

Hello @craigp

One rather simple way to accomplish this, is to evaluate the distance of the vertices of each division cell to its center point. Since you know that your desired side length of the ideal square cell is 3 units, you can calculate the length of its hypothenuse. The hypothenuse divided by two equals the ideal distance from vertex to center point that you can now compare all distances from vertex to corresponding center point to, and cull the vertices which don’t comply!
The tolerance in decimal percent (i.e. 0.05 = 5%) let’s you be more or less forgiving. A small tolerance value is always necessary though, since between all the number crunching some resolution is always lost, which produces inaccurate results, when evaluating the distances. For example, a distances of 4.23, rounded mysteriously by some component, might not be equal to the same value of 4.23412, although it should be, and that is where the tolerance comes into play. :wink:

1 Like

Hi @diff-arch

Yes! This is exactly what i was looking. You’re the master :slight_smile:

Could you please share gh file. I will study.

Thanks again!

I haven’t kept the definition, since it was a quick try, but you should be able to reproduce it from the screenshot.
There’s nothing hidden! The component that displays the formula, is called Expression.
My script starts, where @dowazura’s ended, with the Surface Split (SrfSplit) component.

1 Like

I tried the way you showed above but i get different result:

@diff-arch this is my first post appreciate your help. Thanks a lot!

Any chance of backup file :slight_smile:

Now i understood how you got that result looks like you have used radius 12 in your circle:

Radius 11.5 doesn’t seems to center the points. Any workaround how can we move lines to center of circle?

Cheers!

CircularSrfDiv_re.gh (12.5 KB)

1 Like

@craigp, the result of my solution should be independent off the circle diameter. It solely depends on your desired division length that has to be equal to the individual cell height and width. In your example above, your tolerance is probably too high. A good value would be 0.035 or even lower. If it’s higher more points are accepted.

Example:

31

For a desired division length of 3 units and square cells, the hypothenuse or cell diagonal equals 4.242. Now, the hypothenuse divided by two, equals 2.121, your ideal distance from edge vertex to cell center.
Your tolerance being 0.07, means that you accept values smaller than 2.367 (2.212 + (2.212 * 0.07)) and larger than 2.05716 (2.212 - (2.212 * 0.07)) to find acceptable points.

Centering the points is dependent on @dowazura’s solution, but I think that @HS_Kim already provided a solution.

1 Like