Class Profile
A polygonal perimeter with zero or more polygonal voids.
Inheritance
Inherited Members
Namespace: Elements.Geometry
Assembly: Hypar.Elements.dll
Syntax
public class Profile : Element, INotifyPropertyChanged, IEquatable<Profile>
Constructors
Profile(Polygon)
Construct a profile.
Declaration
public Profile(Polygon perimeter)
Parameters
Type | Name | Description |
---|---|---|
Polygon | perimeter | The perimeter of the profile. |
Profile(Polygon, Polygon)
Construct a profile.
Declaration
public Profile(Polygon perimeter, Polygon void)
Parameters
Type | Name | Description |
---|---|---|
Polygon | perimeter | The perimeter of the profile. |
Polygon | void | A void in the profile. |
Profile(Polygon, IList<Polygon>, Guid, String)
Create a profile.
Declaration
[JsonConstructor]
public Profile(Polygon perimeter, IList<Polygon> voids, Guid id = default(Guid), string name = null)
Parameters
Type | Name | Description |
---|---|---|
Polygon | perimeter | The perimeter of the profile. |
System.Collections.Generic.IList<Polygon> | voids | A collection of voids in the profile. |
System.Guid | id | The id of the profile. |
System.String | name | The name of the profile. |
Profile(IList<Polygon>)
Construct a profile from a collection of polygons. If the collection contains more than one polygon, the first polygon will be used as the perimeter and any remaining polygons will be used as voids.
Declaration
public Profile(IList<Polygon> polygons)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<Polygon> | polygons | The polygons bounding this profile. |
Profile(String)
Default constructor for profile.
Declaration
protected Profile(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Properties
Perimeter
The perimeter of the profile.
Declaration
[JsonProperty("Perimeter", Required = Required.AllowNull)]
public Polygon Perimeter { get; set; }
Property Value
Type | Description |
---|---|
Polygon |
Voids
A collection of Polygons representing voids in the profile.
Declaration
[JsonProperty("Voids", Required = Required.AllowNull)]
public IList<Polygon> Voids { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<Polygon> |
Methods
Area()
The area of the profile.
Declaration
public double Area()
Returns
Type | Description |
---|---|
System.Double |
Contains(Vector3)
Tests if a point is contained within this profile. Returns false for points that are outside of the profile, within voids, or coincident at edges or vertices.
Declaration
public bool Contains(Vector3 point)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | point |
Returns
Type | Description |
---|---|
System.Boolean |
Contains(Vector3, out Containment)
Tests if a point is contained within this profile. Returns false for points that are outside of the profile (or within voids).
Declaration
public bool Contains(Vector3 point, out Containment containment)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | point | The position to test. |
Containment | containment | Whether the point is inside, outside, at an edge, or at a vertex. |
Returns
Type | Description |
---|---|
System.Boolean | True if the point is within the profile. |
CreateFromPolygons(IEnumerable<Polygon>, Double)
Create a collection of profiles from a collection of polygons. Inner polygons will be treated as voids in alternating fashion.
Declaration
public static List<Profile> CreateFromPolygons(IEnumerable<Polygon> polygons, double tolerance = 1E-05)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<Polygon> | polygons | The polygons to sort into profiles |
System.Double | tolerance | An optional tolerance. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Profile> |
Difference(IEnumerable<Profile>, IEnumerable<Profile>, Double)
Perform a difference operation on two sets of profiles.
Declaration
public static List<Profile> Difference(IEnumerable<Profile> firstSet, IEnumerable<Profile> secondSet, double tolerance = 1E-05)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<Profile> | firstSet | The profiles to subtract from. |
System.Collections.Generic.IEnumerable<Profile> | secondSet | The profiles to subtract with. |
System.Double | tolerance | An optional tolerance. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Profile> | A new list of profiles comprising the first set minus the second set. |
Equals(Profile)
Is this profile equal to the provided profile?
Declaration
public bool Equals(Profile other)
Parameters
Type | Name | Description |
---|---|---|
Profile | other | The other profile. |
Returns
Type | Description |
---|---|
System.Boolean |
Intersection(IEnumerable<Profile>, IEnumerable<Profile>, Double)
Constructs the intersections between two sets of profiles.
Declaration
public static List<Profile> Intersection(IEnumerable<Profile> firstSet, IEnumerable<Profile> secondSet, double tolerance = 1E-05)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<Profile> | firstSet | The first set of profiles to intersect with. |
System.Collections.Generic.IEnumerable<Profile> | secondSet | The second set of profiles to intersect with. |
System.Double | tolerance | An optional tolerance. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Profile> | A new list of profiles comprising the overlap between the first set and the second set. |
Offset(IEnumerable<Profile>, Double, Double)
Offset profiles by a given distance.
Declaration
public static List<Profile> Offset(IEnumerable<Profile> profiles, double distance, double tolerance = 1E-05)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<Profile> | profiles | The profiles to offset. |
System.Double | distance | The offset distance. |
System.Double | tolerance | An optional tolerance. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Profile> | A collection of resulting profiles. |
Offset(Double, Double)
Offset this profile by a given distance.
Declaration
public List<Profile> Offset(double distance, double tolerance = 1E-05)
Parameters
Type | Name | Description |
---|---|---|
System.Double | distance | The offset distance. |
System.Double | tolerance | An optional tolerance. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Profile> |
OrientVoids()
Ensure that voids run in an opposite winding direction to the perimeter of the profile. Be sure to call this if you modify the Profile's Voids array directly.
Declaration
public void OrientVoids()
Project(Plane)
Project this profile onto the plane.
Declaration
public Profile Project(Plane plane)
Parameters
Type | Name | Description |
---|---|---|
Plane | plane | The plane of the returned profile. |
Returns
Type | Description |
---|---|
Profile |
Reversed()
Get a new profile which is the reverse of this profile.
Declaration
public Profile Reversed()
Returns
Type | Description |
---|---|
Profile |
Scale(Double)
Return a new profile that is this profile scaled about the origin by the desired amount.
Declaration
public Profile Scale(double amount)
Parameters
Type | Name | Description |
---|---|---|
System.Double | amount |
Returns
Type | Description |
---|---|
Profile |
Segments()
Get all segments from a profile's perimeter and internal voids.
Declaration
public List<Line> Segments()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Line> |
Split(IEnumerable<Profile>, Polyline, Double)
Split a set of profiles with a collection of open polylines.
Declaration
public static List<Profile> Split(IEnumerable<Profile> profiles, Polyline splitLine, double tolerance = 1E-05)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<Profile> | profiles | The profiles to split |
Polyline | splitLine | The polyline defining the splits. |
System.Double | tolerance | An optional tolerance. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Profile> |
Split(IEnumerable<Profile>, IEnumerable<Polyline>, Double)
Split a set of profiles with a collection of open polylines.
Declaration
public static List<Profile> Split(IEnumerable<Profile> profiles, IEnumerable<Polyline> splitLines, double tolerance = 1E-05)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<Profile> | profiles | The profiles to split |
System.Collections.Generic.IEnumerable<Polyline> | splitLines | The polylines defining the splits. |
System.Double | tolerance | An optional tolerance. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Profile> |
Transform(Transform)
Transform this profile in place.
Declaration
public void Transform(Transform t)
Parameters
Type | Name | Description |
---|---|---|
Transform | t | The transform. |
Transformed(Transform)
A transformed copy of this profile.
Declaration
public Profile Transformed(Transform transform)
Parameters
Type | Name | Description |
---|---|---|
Transform | transform | The transform. |
Returns
Type | Description |
---|---|
Profile |
Union(Profile, Double)
Perform a union operation, returning a new profile that is the union of the current profile with the other profile
The profile with which to create a union. An optional tolerance.Declaration
public Profile Union(Profile profile, double tolerance = 1E-05)
Parameters
Type | Name | Description |
---|---|---|
Profile | profile | |
System.Double | tolerance |
Returns
Type | Description |
---|---|
Profile |
UnionAll(IEnumerable<Profile>, Double)
Perform a union operation on a set of multiple profiles.
Declaration
public static List<Profile> UnionAll(IEnumerable<Profile> profiles, double tolerance = 1E-05)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<Profile> | profiles | The profiles with which to create a union. |
System.Double | tolerance | An optional tolerance. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Profile> | A new list of profiles comprising the union of all input profiles. |