Hi
using 3 point rectangle component and in a rare case such result outcome:
i dunno if it is due to tolerance or something else somewhere need to be fixed
rectangle_001.gh (6.0 KB)
Hi
using 3 point rectangle component and in a rare case such result outcome:
i dunno if it is due to tolerance or something else somewhere need to be fixed
You can’t make a rectangle out of co-linear points… must be tolerance. The C value is 2.636e-9 when I load your Grasshopper definition.
Still, it would make more sense if it created a line between A and B.
I think the problem is more on the philosophical side, like it’s possible to define a bad thing, but should not possible to reverse-engineer (retrieve?) a bad thing
Rectangle3d struct
Represents the values of a plane and two intervals that form an oriented rectangle in three dimensions.
https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.rectangle3d?version=8.x
in order to have a valid rectangle you need a valid Plane and x/y intervals
those x/y intervals can be declared with Domain = zero and can produce a zero-area Rectangle, that will be exploded into two -or more- invalid lines, and still be a well defined -bad- Rectangle
here is a well defined bad Rectangle in all its beauty:
but when you turn things around, and instead of defining a -bad- Rectangle yourself, you ask gh to retrieve that for you using 3 points, then results could be a bit unpredictable… because if a valid Plane can’t be defined in first place, then any physical representation of that geometry will also not be valid… and that is the whole point of this matter
I think the only two cases in which a sorted set of 3 good points does not define a plane are if two or more of those are coincident, or if all 3 are colinear… and the specifics of what can be considered coincident / colinear are strictly related to the Tolerance you are using in Rhino (anyway, I guess no one will be going anywhere close to e-9 .___. )
all this to say, I agree the 3Pt component should return a Null and become red to indicate malfunction, because it could not define the Plane on which the Rectangle would be created with the current Tolerance, not because width or length of the Rectangle is zero (but because -in order to define a valid Plane with rectangle 3Pt- you need width/length to be non-zero, then let’s just say it should become red, period )