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

Facets are little more than a link to a HalfEdge, but they provide a convenient interface for manipulating Polyhedrons. Presently, Facets are not guaranteed to be coplanar, convex, and they can be totally broken. More...

Inheritance diagram for PolyLink.Facet:
PolyLink.MathLinked

Public Member Functions

 Facet (HalfEdge head, string color="RGBColor[1,1,1]")
 Constructs a facet More...
 
void ForceHalfEdgesToReferenceThis ()
 Goes through all Half-Edges of this Facet and forces them to reference this Facet in their "Facet" field. More...
 
Facet SubDivide (PointRef v1, PointRef v2)
 Subdivides this facet with an edge from v1 to v2. More...
 
IEnumerable< FacetTriangulate ()
 Triangulates this Facet and returns any new Facets that get created in the process. More...
 
bool CheckIntersectSlow (EndPointPacket p)
 Checks to see is this Facet intersects an Endpointpacket More...
 
bool CheckIntersectSlow (Facet f)
 Checks to see if Facet f intersects with this Facet. More...
 
Expr InsetLabel (int labelNumber)
 Creates a graphics primitive representing an inset label floating .1 units above the facet. More...
 
Expr ClipLabel (int labelNumber)
 Creates a graphics primitive representing a label which can't be covered up More...
 
Expr HELabelsStartingFrom (int startFrom)
 Generates labels for the halfEdges More...
 
HalfEdge PickHalfEdge (int i)
 Allows the user to pick a HalfEdge by cross-referencing with the HELabels More...
 

Properties

string Tag [get, set]
 A tag string for this facet. Useful for debugging. More...
 
bool Convex [get]
 Placeholder convexity checker. More...
 
Expr Color [get, set]
 This facet's color when drawn with Mathematica More...
 
HalfEdge Head [get, set]
 A HalfEdge around this facet designated arbitrarily as the head. Does not change. More...
 
Plane Plane [get]
 Point-normal form of the plane on which this facet lies More...
 
IEnumerable< HalfEdgeHalfEdges [get]
 Enumerates the HalfEdges around this facet starting from Head More...
 
HalfEdge[] HalfEdgeArray [get]
 
Expr Graphics [get]
 Mathematica graphics object which represents the facet More...
 
Expr Highlight [get]
 Returns this facet, but colored Yellow. A good usage of this property is to call Graphics3D[{poly,facet}] in Mathematica, which will give you a graphical representation of the polygon, but with this facet highlighted. More...
 
IEnumerable< PointRefPointRefs [get]
 Enumerates the vertices of this facet More...
 
PointRef[] PointRefArray [get]
 An array of every vertex of this facet More...
 
Expr Points [get]
 A Mathematica List of the coordinates of every vertex More...
 
static Facet TestQuad [get]
 Used for testing. Creates a small square facet in the xy plane. More...
 
Facet CloneWithAllHalfEdgesCloned [get]
 Creates a clone of this Facet that has all new HalfEdges and PointRefs in it, but in the same location in space. More...
 
Expr Midpoint [get]
 Finds the 'Midpoint' of this Facet by averaging all the vertices together. More...
 
Expr HELabels [get]
 Generates labels for the HalfEdges, starting from 1. More...
 
Expr Normal [get]
 Assuming the vertices on this facet are coplanar, gives the normal of this facet. More...
 
Expr NormalGraphics [get]
 Gives a graphical representation of the Normal vector for this facet. More...
 
Expr HEHighlights [get]
 Highlights the HalfEdges of this Facet. More...
 

Detailed Description

Facets are little more than a link to a HalfEdge, but they provide a convenient interface for manipulating Polyhedrons. Presently, Facets are not guaranteed to be coplanar, convex, and they can be totally broken.

Definition at line 12 of file Facet.cs.

Constructor & Destructor Documentation

PolyLink.Facet.Facet ( HalfEdge  head,
string  color = "RGBColor[1,1,1]" 
)

Constructs a facet

Parameters
headA half-edge which is designated as the head. This half-edge should already be part of a loop of HalfEdges which make the sides of this facet.
colorA color for when the facet is represented graphically. Defaults to White.

Definition at line 27 of file Facet.cs.

Member Function Documentation

bool PolyLink.Facet.CheckIntersectSlow ( EndPointPacket  p)

Checks to see is this Facet intersects an Endpointpacket

Parameters
pAn EndPointPacket that may intersect this Facet
Returns
True if the EndPointPacket does intersect this Facet.

Definition at line 241 of file Facet.cs.

bool PolyLink.Facet.CheckIntersectSlow ( Facet  f)

Checks to see if Facet f intersects with this Facet.

Parameters
fFacet that may intersect with this one
Returns
True if there is an intersection

Definition at line 299 of file Facet.cs.

Expr PolyLink.Facet.ClipLabel ( int  labelNumber)

Creates a graphics primitive representing a label which can't be covered up

Parameters
labelNumberNumber with which to label the facet
Returns
The graphics primitive for the label

Definition at line 363 of file Facet.cs.

void PolyLink.Facet.ForceHalfEdgesToReferenceThis ( )

Goes through all Half-Edges of this Facet and forces them to reference this Facet in their "Facet" field.

Definition at line 69 of file Facet.cs.

Expr PolyLink.Facet.HELabelsStartingFrom ( int  startFrom)

Generates labels for the halfEdges

Parameters
startFromThe head HalfEdge gets this label, and the labels for the other HalfEdges increase from there
Returns
The graphics primitive for the labels

Definition at line 373 of file Facet.cs.

Expr PolyLink.Facet.InsetLabel ( int  labelNumber)

Creates a graphics primitive representing an inset label floating .1 units above the facet.

Parameters
labelNumberNumber with which to label the facet
Returns
The graphics primitive for the label

Definition at line 352 of file Facet.cs.

HalfEdge PolyLink.Facet.PickHalfEdge ( int  i)

Allows the user to pick a HalfEdge by cross-referencing with the HELabels

Parameters
iThe HalfEdge index, where 1 is Head, 2 is Head.Next, and so forth
Returns
The selected HalfEdge

Definition at line 398 of file Facet.cs.

Facet PolyLink.Facet.SubDivide ( PointRef  v1,
PointRef  v2 
)

Subdivides this facet with an edge from v1 to v2.

Parameters
v1A vertex of this facet
v2A different vertex of this facet
Returns
The new facet object created by this operation (does not contain Head)

Definition at line 201 of file Facet.cs.

IEnumerable<Facet> PolyLink.Facet.Triangulate ( )

Triangulates this Facet and returns any new Facets that get created in the process.

Returns

Definition at line 228 of file Facet.cs.

Property Documentation

Facet PolyLink.Facet.CloneWithAllHalfEdgesCloned
get

Creates a clone of this Facet that has all new HalfEdges and PointRefs in it, but in the same location in space.

Definition at line 187 of file Facet.cs.

Expr PolyLink.Facet.Color
getset

This facet's color when drawn with Mathematica

Definition at line 51 of file Facet.cs.

bool PolyLink.Facet.Convex
get

Placeholder convexity checker.

Definition at line 40 of file Facet.cs.

Expr PolyLink.Facet.Graphics
get

Mathematica graphics object which represents the facet

Definition at line 94 of file Facet.cs.

HalfEdge [] PolyLink.Facet.HalfEdgeArray
get

Definition at line 86 of file Facet.cs.

IEnumerable<HalfEdge> PolyLink.Facet.HalfEdges
get

Enumerates the HalfEdges around this facet starting from Head

Definition at line 81 of file Facet.cs.

HalfEdge PolyLink.Facet.Head
getset

A HalfEdge around this facet designated arbitrarily as the head. Does not change.

Definition at line 56 of file Facet.cs.

Expr PolyLink.Facet.HEHighlights
get

Highlights the HalfEdges of this Facet.

Definition at line 426 of file Facet.cs.

Expr PolyLink.Facet.HELabels
get

Generates labels for the HalfEdges, starting from 1.

Definition at line 389 of file Facet.cs.

Expr PolyLink.Facet.Highlight
get

Returns this facet, but colored Yellow. A good usage of this property is to call Graphics3D[{poly,facet}] in Mathematica, which will give you a graphical representation of the polygon, but with this facet highlighted.

Definition at line 124 of file Facet.cs.

Expr PolyLink.Facet.Midpoint
get

Finds the 'Midpoint' of this Facet by averaging all the vertices together.

Definition at line 343 of file Facet.cs.

Expr PolyLink.Facet.Normal
get

Assuming the vertices on this facet are coplanar, gives the normal of this facet.

Definition at line 407 of file Facet.cs.

Expr PolyLink.Facet.NormalGraphics
get

Gives a graphical representation of the Normal vector for this facet.

Definition at line 415 of file Facet.cs.

Plane PolyLink.Facet.Plane
get

Point-normal form of the plane on which this facet lies

Definition at line 62 of file Facet.cs.

PointRef [] PolyLink.Facet.PointRefArray
get

An array of every vertex of this facet

Definition at line 148 of file Facet.cs.

IEnumerable<PointRef> PolyLink.Facet.PointRefs
get

Enumerates the vertices of this facet

Definition at line 140 of file Facet.cs.

Expr PolyLink.Facet.Points
get

A Mathematica List of the coordinates of every vertex

Definition at line 156 of file Facet.cs.

string PolyLink.Facet.Tag
getset

A tag string for this facet. Useful for debugging.

Definition at line 20 of file Facet.cs.

Facet PolyLink.Facet.TestQuad
staticget

Used for testing. Creates a small square facet in the xy plane.

Definition at line 166 of file Facet.cs.


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