-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds new classes for raw encoded objects (Brep, Extrusion and Subd) (#…
…139) * feat: adds wip classes for brep/subd/extrusion-x * Get rid of dub code on ExtrusionX SubDX BrepX * fix: Run format * chore: formatting * chore: more formatting help dis annoying --------- Co-authored-by: oguzhankoral <[email protected]> Co-authored-by: Alan Rynne <[email protected]> Co-authored-by: Adam Hathcock <[email protected]>
- Loading branch information
1 parent
1a9d28e
commit 1241589
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
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,33 @@ | ||
using Speckle.Objects.Other; | ||
using Speckle.Sdk.Models; | ||
|
||
namespace Speckle.Objects.Geometry; | ||
|
||
public interface IRawEncodedObject | ||
{ | ||
public RawEncoding encodedValue { get; set; } | ||
} | ||
|
||
public abstract class RawEncodedObject : Base, IDisplayValue<List<Mesh>>, IRawEncodedObject, IHasArea, IHasVolume | ||
{ | ||
[DetachProperty] | ||
public required List<Mesh> displayValue { get; set; } | ||
|
||
[DetachProperty] | ||
public required RawEncoding encodedValue { get; set; } | ||
|
||
public required string units { get; set; } | ||
|
||
public double area { get; set; } | ||
|
||
public double volume { get; set; } | ||
} | ||
|
||
[SpeckleType("Objects.Geometry.BrepX")] | ||
public class BrepX : RawEncodedObject; | ||
|
||
[SpeckleType("Objects.Geometry.ExtrusionX")] | ||
public class ExtrusionX : RawEncodedObject; | ||
|
||
[SpeckleType("Objects.Geometry.SubDX")] | ||
public class SubDX : RawEncodedObject; |
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,23 @@ | ||
using Speckle.Sdk.Models; | ||
|
||
namespace Speckle.Objects.Other; | ||
|
||
/// <summary> | ||
/// Keeps track of a raw-encoded object in a native supported format. see <see cref="RawEncodingFormats"/> | ||
/// </summary> | ||
[SpeckleType("Objects.Other.RawEncoding")] | ||
public class RawEncoding : Base // note: at this stage, since we're using this for extrusions and subds the name doesn't make sense anymore | ||
{ | ||
public required string format { get; set; } | ||
public required string contents { get; set; } | ||
|
||
public RawEncoding() { } | ||
} | ||
|
||
/// <summary> | ||
/// Supported encoding types "strongly" typed strings. This needs to match the extension of the file format. | ||
/// </summary> | ||
public static class RawEncodingFormats | ||
{ | ||
public const string RHINO_3DM = "3dm"; | ||
} |