PolyLink
A library to allow manipulation of geometry from within Mathematica
 All Classes Namespaces Files Functions Variables Properties
PolyLink.HalfEdge Class Reference

The building blocks of a geometric model, a HalfEdge consists of a reference to a start and end point, and links to the counter-clockwise Next, Previous, and Oppostie HalfEdges. More...

Inheritance diagram for PolyLink.HalfEdge:
PolyLink.MathLinked

Public Member Functions

HalfEdge[] DetourToVertex (PointRef p)
 Create a pair of Half-Edges following this one, which go from this's End to p, and back again More...
 
Dictionary< HalfEdge, HalfEdgeLinkNext (HalfEdge he)
 Links a HalfEdge to this one and saves references to possibly unlinked HalfEdges More...
 
void MergeAcross ()
 Removes this HalfEdge and joins two neighboring facets More...
 
override string ToString ()
 
 HalfEdge (PointRef start, PointRef end)
 
void Unfold (IEnumerable< PointRef > stowaways=null, IEnumerable< HalfEdge > stowawayHalfEdges=null)
 Moves the entire Facet so that it is coplanar with the neighbor opposite this HalfEdge. More...
 
void TransformFacet (Expr matrix)
 Transforms every HalfEdge in the facet by a matrix. More...
 
void UselessTransform ()
 Transforms the facet by translating it {0,0,0}. In other words, doesn't move the facet at all. More...
 
void Anchor (IEnumerable< PointRef > stowaways)
 Moves the facet so that this HalfEdge's start point is at the origin, the EndPoint is in the direction {1,0,0}, and the whole facet is in the xy plane. More...
 
void Transform (Expr transform, bool includeStart=true, bool includeEnd=true)
 Transforms just this HalfEdge. More...
 
void NegativeTranslate (Vector v)
 Translates this HalfEdge in the opposite direction as the vector v. More...
 
Expr Label (int i)
 Returns a Mathematica graphics primitive for an inset label above this HalfEdge. More...
 
void MoveStartPoint (Expr p)
 
IEnumerable< HalfEdgeBreadthFirstGrab (bool includeTorn=false)
 Creates a list of all connected half-edges in Breadth-First order, starting from here. More...
 
void CascadingUnfold (Polyhedron p)
 Unfolds along a halfedge and moves whole sections of the polyhedron with it. More...
 
IEnumerable< PointRefBreadthFirstPoints ()
 
IEnumerable< HalfEdgeBreadthFirstGrabAll ()
 

Protected Attributes

PointRef _start
 
PointRef _end
 
HalfEdge _opposite
 
HalfEdge _next
 
HalfEdge _prev
 

Properties

Facet Facet [get, set]
 Reference to the Facet that owns this HalfEdge. More...
 
string Tag [get]
 A string used to identify this HalfEdge. Not used in code, but useful for debugging. More...
 
EndPointPacket EndPointPacket [get]
 Exports the EndpointPacket for this HalfEdge More...
 
EndPointPacket OppositesEndPointPacket [get]
 Exports the OppositeEndpointPacket for this HalfEdge More...
 
PointRef Start [get, set]
 Reference to the start point of this HalfEdge. More...
 
PointRef End [get, set]
 Reference to the end point of this HalfEdge. More...
 
HalfEdge Opposite [get, set]
 The HalfEdge which represnts the same edge but bounds a neighboring facet More...
 
HalfEdge Next [get]
 The next HalfEdge going counterclockwise More...
 
HalfEdge Prev [get]
 The previous Halfedge More...
 
IEnumerable< HalfEdgeHEsFromHere [get]
 Enumerates the halfedges around the facet that this binds More...
 
IEnumerable< HalfEdgeHEsFromHereReversed [get]
 Enumerates the halfedges around the facet that this binds, but in reverse order. More...
 
Expr AsVectorExpr [get]
 Gives the displacement vector from Start to End More...
 
Vector AsVector [get]
 Gives the displacement vector from Start to End, as a Vector object. More...
 
Plane Plane [get]
 Gives the plane containing this HalfEdge More...
 
Expr DotOpposite [get]
 Dots this halfedge's facet with the facet's neighbor along this halfedge. More...
 
bool OppIsNull [get]
 Returns true iff opposite is null More...
 
bool DontCycle [get, set]
 Designates that this HalfEdge should break the cycle if the CycleBoutEndPoint property is called. Useful for if a HalfEdge is a working copy that references a real HalfEdge. More...
 
IEnumerable< HalfEdgeCycleAboutEndPoint [get]
 Enumerates all HalfEdges which have End as their end point More...
 
Expr DotNext [get]
 Turns the dot product of this and next More...
 
Expr AngleToNext [get]
 Angle between this and next More...
 
Expr SumAngles [get]
 Sum of all angles around this vertex More...
 
Expr Curvature [get]
 Curvature of this vertex More...
 
Expr Highlight [get]
 A graphics primitive that indicates this HalfEdge with a Thick Red Arrow. More...
 
static HalfEdge LittleLine [get]
 For testing More...
 
static HalfEdge Facetable [get]
 For testing More...
 
Expr NormalGraphics [get]
 Graphics Primitive to visualize the Normal of this HalfEdge. More...
 
bool Torn [get]
 Returns true iff this HalfEdge's opposite is not made of the same point reference as this. More...
 
Expr Graphics [get]
 Give a graphical representation of the link between this HalfEdge and its opposite. More...
 
HalfEdge FacetCloneWithOriginalOpposites [get]
 Clones all the HalfEdges in this HalfEdge's facet, then gives each HalfEdge a link to the (original) opposite. More...
 
HalfEdge FacetRingClone [get]
 Clones all the HalfEdges in this HalfEdge's facet More...
 
HalfEdge ShallowClone [get]
 Creates a "Shallow Clone" of this HalfEdge, using the original Start, End, Next, and Prev. Opposite is set to null. More...
 
Expr Midpoint [get]
 Gives the midpoint between Start and End. More...
 
Facet ForceNewFacet [get]
 
IEnumerable< PointRefStartPointsFromHere [get]
 

Detailed Description

The building blocks of a geometric model, a HalfEdge consists of a reference to a start and end point, and links to the counter-clockwise Next, Previous, and Oppostie HalfEdges.

Definition at line 14 of file HalfEdge.cs.

Constructor & Destructor Documentation

PolyLink.HalfEdge.HalfEdge ( PointRef  start,
PointRef  end 
)

Definition at line 365 of file HalfEdge.cs.

Member Function Documentation

void PolyLink.HalfEdge.Anchor ( IEnumerable< PointRef stowaways)

Moves the facet so that this HalfEdge's start point is at the origin, the EndPoint is in the direction {1,0,0}, and the whole facet is in the xy plane.

Definition at line 492 of file HalfEdge.cs.

IEnumerable<HalfEdge> PolyLink.HalfEdge.BreadthFirstGrab ( bool  includeTorn = false)

Creates a list of all connected half-edges in Breadth-First order, starting from here.

Parameters
includeTorn
Returns

Definition at line 690 of file HalfEdge.cs.

IEnumerable<HalfEdge> PolyLink.HalfEdge.BreadthFirstGrabAll ( )

Definition at line 759 of file HalfEdge.cs.

IEnumerable<PointRef> PolyLink.HalfEdge.BreadthFirstPoints ( )

Definition at line 754 of file HalfEdge.cs.

void PolyLink.HalfEdge.CascadingUnfold ( Polyhedron  p)

Unfolds along a halfedge and moves whole sections of the polyhedron with it.

Parameters
p

Definition at line 730 of file HalfEdge.cs.

HalfEdge [] PolyLink.HalfEdge.DetourToVertex ( PointRef  p)

Create a pair of Half-Edges following this one, which go from this's End to p, and back again

Parameters
p

Definition at line 181 of file HalfEdge.cs.

Expr PolyLink.HalfEdge.Label ( int  i)

Returns a Mathematica graphics primitive for an inset label above this HalfEdge.

Parameters
iThe number for the label
Returns

Definition at line 665 of file HalfEdge.cs.

Dictionary<HalfEdge, HalfEdge> PolyLink.HalfEdge.LinkNext ( HalfEdge  he)

Links a HalfEdge to this one and saves references to possibly unlinked HalfEdges

Parameters
heHalfEdge which will become the new next
Returns
Small Dictionary. Value[this] is the old Next of this. Value[he] is the old Prev of he.

Definition at line 212 of file HalfEdge.cs.

void PolyLink.HalfEdge.MergeAcross ( )

Removes this HalfEdge and joins two neighboring facets

Definition at line 233 of file HalfEdge.cs.

void PolyLink.HalfEdge.MoveStartPoint ( Expr  p)

Definition at line 672 of file HalfEdge.cs.

void PolyLink.HalfEdge.NegativeTranslate ( Vector  v)

Translates this HalfEdge in the opposite direction as the vector v.

Parameters
v

Definition at line 584 of file HalfEdge.cs.

override string PolyLink.HalfEdge.ToString ( )

Definition at line 245 of file HalfEdge.cs.

void PolyLink.HalfEdge.Transform ( Expr  transform,
bool  includeStart = true,
bool  includeEnd = true 
)

Transforms just this HalfEdge.

Parameters
transformA transform matrix by which to transform the start and end points of this HalfEdge.

Definition at line 550 of file HalfEdge.cs.

void PolyLink.HalfEdge.TransformFacet ( Expr  matrix)

Transforms every HalfEdge in the facet by a matrix.

Parameters
matrixmatrix to transform this facet

Definition at line 465 of file HalfEdge.cs.

void PolyLink.HalfEdge.Unfold ( IEnumerable< PointRef stowaways = null,
IEnumerable< HalfEdge stowawayHalfEdges = null 
)

Moves the entire Facet so that it is coplanar with the neighbor opposite this HalfEdge.

Definition at line 388 of file HalfEdge.cs.

void PolyLink.HalfEdge.UselessTransform ( )

Transforms the facet by translating it {0,0,0}. In other words, doesn't move the facet at all.

Definition at line 482 of file HalfEdge.cs.

Member Data Documentation

PointRef PolyLink.HalfEdge._end
protected

Definition at line 71 of file HalfEdge.cs.

HalfEdge PolyLink.HalfEdge._next
protected

Definition at line 87 of file HalfEdge.cs.

HalfEdge PolyLink.HalfEdge._opposite
protected

Definition at line 73 of file HalfEdge.cs.

HalfEdge PolyLink.HalfEdge._prev
protected

Definition at line 88 of file HalfEdge.cs.

PointRef PolyLink.HalfEdge._start
protected

Definition at line 70 of file HalfEdge.cs.

Property Documentation

Expr PolyLink.HalfEdge.AngleToNext
get

Angle between this and next

Definition at line 290 of file HalfEdge.cs.

Vector PolyLink.HalfEdge.AsVector
get

Gives the displacement vector from Start to End, as a Vector object.

Definition at line 152 of file HalfEdge.cs.

Expr PolyLink.HalfEdge.AsVectorExpr
get

Gives the displacement vector from Start to End

Definition at line 144 of file HalfEdge.cs.

Expr PolyLink.HalfEdge.Curvature
get

Curvature of this vertex

Definition at line 313 of file HalfEdge.cs.

IEnumerable<HalfEdge> PolyLink.HalfEdge.CycleAboutEndPoint
get

Enumerates all HalfEdges which have End as their end point

Definition at line 260 of file HalfEdge.cs.

bool PolyLink.HalfEdge.DontCycle
getset

Designates that this HalfEdge should break the cycle if the CycleBoutEndPoint property is called. Useful for if a HalfEdge is a working copy that references a real HalfEdge.

Definition at line 254 of file HalfEdge.cs.

Expr PolyLink.HalfEdge.DotNext
get

Turns the dot product of this and next

Definition at line 282 of file HalfEdge.cs.

Expr PolyLink.HalfEdge.DotOpposite
get

Dots this halfedge's facet with the facet's neighbor along this halfedge.

Definition at line 173 of file HalfEdge.cs.

PointRef PolyLink.HalfEdge.End
getset

Reference to the end point of this HalfEdge.

Definition at line 65 of file HalfEdge.cs.

EndPointPacket PolyLink.HalfEdge.EndPointPacket
get

Exports the EndpointPacket for this HalfEdge

Definition at line 34 of file HalfEdge.cs.

Facet PolyLink.HalfEdge.Facet
getset

Reference to the Facet that owns this HalfEdge.

Definition at line 20 of file HalfEdge.cs.

HalfEdge PolyLink.HalfEdge.Facetable
staticget

For testing

Definition at line 343 of file HalfEdge.cs.

HalfEdge PolyLink.HalfEdge.FacetCloneWithOriginalOpposites
get

Clones all the HalfEdges in this HalfEdge's facet, then gives each HalfEdge a link to the (original) opposite.

Definition at line 594 of file HalfEdge.cs.

HalfEdge PolyLink.HalfEdge.FacetRingClone
get

Clones all the HalfEdges in this HalfEdge's facet

Definition at line 613 of file HalfEdge.cs.

Facet PolyLink.HalfEdge.ForceNewFacet
get

Definition at line 678 of file HalfEdge.cs.

Expr PolyLink.HalfEdge.Graphics
get

Give a graphical representation of the link between this HalfEdge and its opposite.

Definition at line 569 of file HalfEdge.cs.

IEnumerable<HalfEdge> PolyLink.HalfEdge.HEsFromHere
get

Enumerates the halfedges around the facet that this binds

Definition at line 110 of file HalfEdge.cs.

IEnumerable<HalfEdge> PolyLink.HalfEdge.HEsFromHereReversed
get

Enumerates the halfedges around the facet that this binds, but in reverse order.

Definition at line 127 of file HalfEdge.cs.

Expr PolyLink.HalfEdge.Highlight
get

A graphics primitive that indicates this HalfEdge with a Thick Red Arrow.

Definition at line 321 of file HalfEdge.cs.

HalfEdge PolyLink.HalfEdge.LittleLine
staticget

For testing

Definition at line 335 of file HalfEdge.cs.

Expr PolyLink.HalfEdge.Midpoint
get

Gives the midpoint between Start and End.

Definition at line 655 of file HalfEdge.cs.

HalfEdge PolyLink.HalfEdge.Next
get

The next HalfEdge going counterclockwise

Definition at line 94 of file HalfEdge.cs.

Expr PolyLink.HalfEdge.NormalGraphics
get

Graphics Primitive to visualize the Normal of this HalfEdge.

Definition at line 360 of file HalfEdge.cs.

bool PolyLink.HalfEdge.OppIsNull
get

Returns true iff opposite is null

Definition at line 226 of file HalfEdge.cs.

HalfEdge PolyLink.HalfEdge.Opposite
getset

The HalfEdge which represnts the same edge but bounds a neighboring facet

Definition at line 79 of file HalfEdge.cs.

EndPointPacket PolyLink.HalfEdge.OppositesEndPointPacket
get

Exports the OppositeEndpointPacket for this HalfEdge

Definition at line 45 of file HalfEdge.cs.

Plane PolyLink.HalfEdge.Plane
get

Gives the plane containing this HalfEdge

Definition at line 160 of file HalfEdge.cs.

HalfEdge PolyLink.HalfEdge.Prev
get

The previous Halfedge

Definition at line 102 of file HalfEdge.cs.

HalfEdge PolyLink.HalfEdge.ShallowClone
getprotected

Creates a "Shallow Clone" of this HalfEdge, using the original Start, End, Next, and Prev. Opposite is set to null.

Definition at line 637 of file HalfEdge.cs.

PointRef PolyLink.HalfEdge.Start
getset

Reference to the start point of this HalfEdge.

Definition at line 56 of file HalfEdge.cs.

IEnumerable<PointRef> PolyLink.HalfEdge.StartPointsFromHere
get

Definition at line 722 of file HalfEdge.cs.

Expr PolyLink.HalfEdge.SumAngles
get

Sum of all angles around this vertex

Definition at line 302 of file HalfEdge.cs.

string PolyLink.HalfEdge.Tag
get

A string used to identify this HalfEdge. Not used in code, but useful for debugging.

Definition at line 26 of file HalfEdge.cs.

bool PolyLink.HalfEdge.Torn
get

Returns true iff this HalfEdge's opposite is not made of the same point reference as this.

Definition at line 376 of file HalfEdge.cs.


The documentation for this class was generated from the following file: