PolyLine.GetPoints() returns 4 points for a rectangular, closed polyline
See original GitHub issueRevit ConvertOpening
expects PolyLine.GetPoints()
to return 5 points:
if (poly == null || poly.GetPoints().Count != 5)
throw new SpeckleException($"Curve outline for wall opening must be a rectangle-shaped polyline.");
Either this needs to become
if (poly == null || poly.GetPoints().Count != 4 || !poly.closed))
or PolyLine.GetPoints()
has to return 5 points if polyline is closed.
Or is the approach here that for some reason start and end point of a rectangle are not unique?
Happy to create a PR for that 😃
Issue Analytics
- State:
- Created a year ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Polyline (JavaFX 8)
Creates a polyline, defined by the array of the segment points. ... class is similar to the Polygon class, except that it is...
Read more >extract rectangle points - AutoCAD Community
I know you know this; I'm just explaining to the OP and any lurkers... A LWPOLYLINE (aka "AcDbPolyline") returns coordinates as (x1 y1...
Read more >JavaFX | Polyline with examples
getPoints(), gets the points of the polyline segments. toString(), Returns a string representation of this Polyline object.
Read more >creating continuous spline curve in javafx
Now the only way I found is to implement a polyline with joint points, calculate the points of catmull curve after getting three...
Read more >how to check if every entity/polyline on your drawing is ...
You have 4 single 2-Point lines building a closed rectangle. The result is a closed polyline, no matter what is selected first. On...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If I understand correctly that type of opening is always rectangular in Revit. That said, when I create a rectangular polyline myself it has by definition only 4 points:
So either the check in the Revit converter or the definition of how polylines are stored is wrong…
Hi @tlmnrnhrdt and @d3ssy!
You are right! And if I hadn’t made a gif of it working (commits included) I would have been doubting myself if it ever worked 😓
Not sure what happened there but I did some tests yesterday and that condition needs changing. Since we’re releasing a new version i’m going to push it in myself so this change get’s included.
As for the
RevitWallOpening
constructor, I agree it is currently “too generic” and should be more specific. I’m working on a fix for the upcoming release too. This is already tracked here https://github.com/specklesystems/speckle-sharp/issues/1199 😃