-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dui3 124 receiving curves arcs ellipses nurbs curves (#3521)
* arcs received (tested with Rhino and AutoCAD commits) * add SpatialRef to every new host geometry * don't receive non-flat arcs, circles, ellipses * more specific exceptions * namespaces and densification for arc-polygon edges * added ICurve converter (not used yet); added check for sequential Polycurve * precision points
- Loading branch information
1 parent
b6141ff
commit a71d37d
Showing
43 changed files
with
442 additions
and
337 deletions.
There are no files selected for viewing
35 changes: 0 additions & 35 deletions
35
...X/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Features/PointFeatureToSpeckleConverter.cs
This file was deleted.
Oops, something went wrong.
54 changes: 0 additions & 54 deletions
54
...ers/ArcGIS/Speckle.Converters.ArcGIS3/Geometry/ISpeckleObjectToHost/ArcToHostConverter.cs
This file was deleted.
Oops, something went wrong.
53 changes: 0 additions & 53 deletions
53
...ArcGIS/Speckle.Converters.ArcGIS3/Geometry/ISpeckleObjectToHost/EllipseToHostConverter.cs
This file was deleted.
Oops, something went wrong.
46 changes: 0 additions & 46 deletions
46
...cGIS/Speckle.Converters.ArcGIS3/Geometry/ISpeckleObjectToHost/PolycurveToHostConverter.cs
This file was deleted.
Oops, something went wrong.
65 changes: 0 additions & 65 deletions
65
...verters/ArcGIS/Speckle.Converters.ArcGIS3/Geometry/SegmentCollectionToSpeckleConverter.cs
This file was deleted.
Oops, something went wrong.
52 changes: 52 additions & 0 deletions
52
DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/Raw/CurveToHostConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using Objects; | ||
using Speckle.Converters.Common.Objects; | ||
|
||
namespace Speckle.Converters.ArcGIS3.ToHost.Raw; | ||
|
||
public class CurveToHostConverter : ITypedConverter<ICurve, ACG.Polyline> | ||
{ | ||
private readonly ITypedConverter<SOG.Line, ACG.Polyline> _lineConverter; | ||
private readonly ITypedConverter<SOG.Arc, ACG.Polyline> _arcConverter; | ||
private readonly ITypedConverter<SOG.Ellipse, ACG.Polyline> _ellipseConverter; | ||
private readonly ITypedConverter<SOG.Circle, ACG.Polyline> _circleConverter; | ||
private readonly ITypedConverter<SOG.Polyline, ACG.Polyline> _polylineConverter; | ||
private readonly ITypedConverter<SOG.Polycurve, ACG.Polyline> _polyCurveConverter; | ||
|
||
public CurveToHostConverter( | ||
ITypedConverter<SOG.Line, ACG.Polyline> lineConverter, | ||
ITypedConverter<SOG.Arc, ACG.Polyline> arcConverter, | ||
ITypedConverter<SOG.Ellipse, ACG.Polyline> ellipseConverter, | ||
ITypedConverter<SOG.Circle, ACG.Polyline> circleConverter, | ||
ITypedConverter<SOG.Polyline, ACG.Polyline> polylineConverter, | ||
ITypedConverter<SOG.Polycurve, ACG.Polyline> polyCurveConverter | ||
) | ||
{ | ||
_lineConverter = lineConverter; | ||
_arcConverter = arcConverter; | ||
_ellipseConverter = ellipseConverter; | ||
_circleConverter = circleConverter; | ||
_polylineConverter = polylineConverter; | ||
_polyCurveConverter = polyCurveConverter; | ||
} | ||
|
||
/// <summary> | ||
/// Converts a given ICurve object to an ACG.Polyline object. | ||
/// </summary> | ||
/// <param name="target">The ICurve object to convert.</param> | ||
/// <returns>The converted RG.Curve object.</returns> | ||
/// <exception cref="NotSupportedException">Thrown when the conversion is not supported for the given type of curve.</exception> | ||
/// <remarks>⚠️ This conversion does NOT perform scaling.</remarks> | ||
public ACG.Polyline Convert(ICurve target) => | ||
target switch | ||
{ | ||
SOG.Line line => _lineConverter.Convert(line), | ||
SOG.Arc arc => _arcConverter.Convert(arc), | ||
SOG.Circle circle => _circleConverter.Convert(circle), | ||
SOG.Ellipse ellipse => _ellipseConverter.Convert(ellipse), | ||
SOG.Spiral spiral => _polylineConverter.Convert(spiral.displayValue), | ||
SOG.Polyline polyline => _polylineConverter.Convert(polyline), | ||
SOG.Curve curve => _polylineConverter.Convert(curve.displayValue), | ||
SOG.Polycurve polyCurve => _polyCurveConverter.Convert(polyCurve), | ||
_ => throw new NotSupportedException($"Unable to convert curves of type {target.GetType().Name}") | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...esToHost/MultipatchListToHostConverter.cs → ...Host/Raw/MultipatchListToHostConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...metriesToHost/PointListToHostConverter.cs → ...S3/ToHost/Raw/PointListToHostConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.