Hello,
I'm trying to retrieve geometry from a view via IExportContext2D and I seem to be unable to extract arcs precisely.
The example below shows a chair in plan view, and two different results that I was able to get.
Getting the geometry via `OnCurve` method (left) provides precise geometry, but it also includes curves that are obstructed by a table in the view (here I used `curveNode.GetCurve().Tessellate()` for non-linear curves).
The geometry in the center was created via `OnPolylineSegments` method, which returns correct segments in terms of visibility, but the tessellation of the corners is very rough.
I'm wondering if there is a way to control the tessellation tolerance of polyline segments, or any other way to extract more precise geometry not including the hidden parts of it.
Thanks,
Michael
It looks to me from the example that it isn't a case of resolution but instead OnPolylineSegments just giving you a polyline without arcs. From reading the RevitAPI.chm for that method it leads me to believe that it will only tesselate the curve if it is not a supported curve type in the API. However that assumption depends on what they mean by 'unhandled' curve. I assume it means something the API doesn't 'handle' which wouldn't be the case for Arc.
In terms of resolution it will probably just give you what is appropriate for the view being printed in terms of scale. Ultimately I think this is using the same mechanism as view printing etc. and nobody sees hexagons representing circles in that output.
Interesting comments regarding occlusion. Does then the extent of the OnPolylineSegments lines give you a context indicating what to hide in the tessellated curve from OnCurve? i.e. your tessellated curve is also a polyline. So when you overlay one with the other can you ascertain which segments from OnCurve (those between the ones obtained from OnPolylineSegments) should be omitted?
Thanks Thomas,
What I get from OnPolylineSegments is this:
IList<XYZ> points = segments.GetVertices();
indeed it does look like these are segments without arcs, or just the endpoints of each segment disregarding if it's a line or a curve.
Using a bounding box of `OnPolylineSegments` result to trim the curves I get from `OnCurve` might do the job, but I'm concerned about the performance of this, or similar methods since I'll need to run this on multiple views with many geometries. And since it's my first try on IExportContext2D I feel like I might be missing something that would provide good results without extra geometric analysis (other event, or a setting in CustomExporter, etc.)
Can't find what you're looking for? Ask the community or share your knowledge.