Hello Friends,

Is it possible to determine the widths or lengths of a surface (non-rectangular), either minimum or maximum values, I am only aware of the bounding box method to get values of regular shapes.

Hello Friends,

Is it possible to determine the widths or lengths of a surface (non-rectangular), either minimum or maximum values, I am only aware of the bounding box method to get values of regular shapes.

- Get the bounding box.
- Get the distance from the min point to the max point of the bounding box.
- Get the perimeter curves of the surface.
- Get the tangent vector at a parameter (or two - more parameters will make more accuracy but will slow the calculation time) along each curve.
- Get the points at matching parameters.
- Draw lines at each point using a Line.ByPointDirectionDistance where the points are the points (5), the tangent vectors are your directions (4), and your distance is your bounding box diagonal (2).
- Intersect those lines with your surface to trim them at the extents.
- Filter the new collections of lines by Geometry.DoesIntersect between the new lines and the original perimeter curve set. This will clean out any ‘split’ curves which intersect across a void.

1 Like

Not sure how well this would work but this is how I would start to tackle the problem:

- Get perimeter curves of surface.
- Group by parallel directions.
- Find distance between all curves within each group.
- Offset a point (probably center) on one curve at half the distance towards each other curve within each group. This would be x-lacing.
- If the point created in step 4 lies on surface, it is likely that the two lines used to create that point are of same path.
- Find distance between those two lines.

A really bad drawing:

How do I group by parallel directions?

When you have the lines, you can get the direction using Line.Direction node and then groupbykey to organize them.

I am not sure how to group by keys… by vectors?

I am quite new here…

I would recommend against the route I suggested then. It is very code heavy and just to get lines grouped together required me to use a custom function to convert curves to lines (Surface.PerimeterCurves gives curves which have no direction vector) and a python script to take those vectors, normalize them, and absolute them.

Maybe someone else can offer a better strategy.

I would like to see it if you are willing to share

I didn’t get any significant progress done, only up to the grouping of lines by similar vectors and only made it work for if they are straight left/right or up/down.

It would be a great if you guys can show me how to trim these lines from the workflow @jacob.small suggested, that would do the job I guess.

Try to swap the Curve.TangentAtParameter for a Curve.NormalAtParameter. Got myself backwards as I typed up the workflow.

Changed it. Not quite sure where it goes.

is this with Curve.NormalAtParameter with the parameter at 0.5?

try it with 0 or 1.

just a hunch

1 Like

Add a vector.Reverse node right after it. That should fix the angle issue.

still not successful

Thanks for the help, the green graph would actually work to get the minimum as you said. (I will have to forget the non parallel stuff)

Wondering if the cross product would work on multiple lists to get to multiple minimum values at the very end for respective multiple surfaces. Tried a few ways but couldn’t figure out

54 results when using cross product is not much if you have 38 inputs