VectSharp 2.5.0
A light library for C# vector graphics
Loading...
Searching...
No Matches
VectSharp.ThreeD.ObjectFactory Class Reference

A static class containing methods to create complex 3D objects. More...

Static Public Member Functions

static List< Element3D > CreateCube (Point3D center, double size, IEnumerable< IMaterial > fill, string tag=null, int zIndex=0)
 Creates a cube. More...
 
static List< Element3D > CreateCuboid (Point3D center, double sizeX, double sizeY, double sizeZ, IEnumerable< IMaterial > fill, string tag=null, int zIndex=0)
 Creates a cuboid. More...
 
static List< Element3D > CreateRectangle (Point3D point1, Point3D point2, Point3D point3, Point3D point4, IEnumerable< IMaterial > fill, string tag=null, int zIndex=0)
 Creates a quadrilater. All the vertices need not be coplanar. More...
 
static List< Element3D > CreateRectangle (Point3D point1, Point3D point2, Point3D point3, Point3D point4, NormalizedVector3D point1Normal, NormalizedVector3D point2Normal, NormalizedVector3D point3Normal, NormalizedVector3D point4Normal, IEnumerable< IMaterial > fill, string tag=null, int zIndex=0)
 Creates a quadrilater, specifying the vertex normals at the four vertices. All the vertices need not be coplanar. More...
 
static List< Element3D > CreateSphere (Point3D center, double radius, int steps, IEnumerable< IMaterial > fill, string tag=null, int zIndex=0)
 Creates a sphere. More...
 
static List< Element3D > CreateTetrahedron (Point3D center, double radius, IEnumerable< IMaterial > fill, string tag=null, int zIndex=0)
 Creates a tetrahedron inscribed in a sphere. More...
 
static List< Element3D > CreatePolygon (GraphicsPath polygon2D, double triangulationResolution, Point3D origin, NormalizedVector3D xAxis, NormalizedVector3D yAxis, bool reverseTriangles, IEnumerable< IMaterial > fill, string tag=null, int zIndex=0)
 Creates a flat polygon. More...
 
static List< Element3D > CreatePrism (GraphicsPath polygonBase2D, double triangulationResolution, Point3D bottomOrigin, Point3D topOrigin, NormalizedVector3D baseXAxis, NormalizedVector3D baseYAxis, IEnumerable< IMaterial > fill, string tag=null, int zIndex=0)
 Creates a prism with the specified base. More...
 
static List< Element3D > CreateWireframe (IEnumerable< Element3D > object3D, Colour colour, double thickness=1, LineCaps lineCap=LineCaps.Butt, LineDash? lineDash=null, string tag=null, int zIndex=0)
 Creates a wireframe from a collection of Element3Ds. More...
 
static List< Element3D > CreatePoints (IEnumerable< Element3D > object3D, Colour colour, double diameter=1, string tag=null, int zIndex=0)
 Obtains a list of Point3DElement corresponding to the vertices of a list of Element3Ds. More...
 

Detailed Description

A static class containing methods to create complex 3D objects.

Definition at line 28 of file ObjectFactory.cs.

Member Function Documentation

◆ CreateCube()

static List< Element3D > VectSharp.ThreeD.ObjectFactory.CreateCube ( Point3D  center,
double  size,
IEnumerable< IMaterial fill,
string  tag = null,
int  zIndex = 0 
)
static

Creates a cube.

Parameters
centerThe centre of the cube.
sizeThe length of each side of the cube.
fillA collection of materials that will be applied to the Triangle3DElements returned by this method.
tagA tag that will be applied to the Triangle3DElements returned by this method.
zIndexA z-index that will be applied to the Triangle3DElements returned by this method.
Returns
A list of Triangle3DElements that constitute the cube.

Definition at line 39 of file ObjectFactory.cs.

◆ CreateCuboid()

static List< Element3D > VectSharp.ThreeD.ObjectFactory.CreateCuboid ( Point3D  center,
double  sizeX,
double  sizeY,
double  sizeZ,
IEnumerable< IMaterial fill,
string  tag = null,
int  zIndex = 0 
)
static

Creates a cuboid.

Parameters
centerThe centre of the cube.
sizeXThe length of the sides of the cube parallel to the x axis.
sizeYThe length of the sides of the cube parallel to the y axis.
sizeZThe length of the sides of the cube parallel to the z axis.
fillA collection of materials that will be applied to the Triangle3DElements returned by this method.
tagA tag that will be applied to the Triangle3DElements returned by this method.
zIndexA z-index that will be applied to the Triangle3DElements returned by this method.
Returns
A list of Triangle3DElements that constitute the cuboid.

Definition at line 55 of file ObjectFactory.cs.

◆ CreatePoints()

static List< Element3D > VectSharp.ThreeD.ObjectFactory.CreatePoints ( IEnumerable< Element3D >  object3D,
Colour  colour,
double  diameter = 1,
string  tag = null,
int  zIndex = 0 
)
static

Obtains a list of Point3DElement corresponding to the vertices of a list of Element3Ds.

Parameters
object3DThe collection of Element3Ds. Point3DElements are ignored.
colourThe colour of the Point3DElements returned by this method.
diameterThe diameter of the Point3DElements returned by this method.
tagA tag that will be applied to the Point3DElements returned by this method.
zIndexA z-index that will be applied to the Point3DElements returned by this method.
Returns
A list of Point3DElements corresponding to the vertices of the Element3Ds.

Definition at line 412 of file ObjectFactory.cs.

◆ CreatePolygon()

static List< Element3D > VectSharp.ThreeD.ObjectFactory.CreatePolygon ( GraphicsPath  polygon2D,
double  triangulationResolution,
Point3D  origin,
NormalizedVector3D  xAxis,
NormalizedVector3D  yAxis,
bool  reverseTriangles,
IEnumerable< IMaterial fill,
string  tag = null,
int  zIndex = 0 
)
static

Creates a flat polygon.

Parameters
polygon2DA 2D GraphicsPath representing the polygon.
triangulationResolutionThe resolution that will be used to linearise curve segments in the GraphicsPath.
originA Point3D that will correspond to the origin of the 2D reference system.
xAxisA NormalizedVector3D that will correspond to the x axis of the 2D reference system. This will be orthonormalised to the yAxis .
yAxisA NormalizedVector3D that will correspond to the y axis of the 2D reference system.
reverseTrianglesIndicates whether the order of the points (and thus the normals) of all the triangles returned by this method should be reversed.
fillA collection of materials that will be applied to the Triangle3DElements returned by this method.
tagA tag that will be applied to the Triangle3DElements returned by this method.
zIndexA z-index that will be applied to the Triangle3DElements returned by this method.
Returns
A list of Triangle3DElements that constitute the polygon.

Definition at line 273 of file ObjectFactory.cs.

◆ CreatePrism()

static List< Element3D > VectSharp.ThreeD.ObjectFactory.CreatePrism ( GraphicsPath  polygonBase2D,
double  triangulationResolution,
Point3D  bottomOrigin,
Point3D  topOrigin,
NormalizedVector3D  baseXAxis,
NormalizedVector3D  baseYAxis,
IEnumerable< IMaterial fill,
string  tag = null,
int  zIndex = 0 
)
static

Creates a prism with the specified base.

Parameters
polygonBase2DA 2D GraphicsPath representing the base of the prism.
triangulationResolutionThe resolution that will be used to linearise curve segments in the GraphicsPath.
bottomOriginA Point3D that will correspond to the origin of the 2D reference system of the bottom base.
topOriginA Point3D that will correspond to the origin of the 2D reference system of the top base.
baseXAxisA NormalizedVector3D that will correspond to the x axis of the 2D reference system of the bases. This will be orthonormalised to the baseYAxis .
baseYAxisA NormalizedVector3D that will correspond to the y axis of the 2D reference system of the bases.
fillA collection of materials that will be applied to the Triangle3DElements returned by this method.
tagA tag that will be applied to the Triangle3DElements returned by this method.
zIndexA z-index that will be applied to the Triangle3DElements returned by this method.
Returns
A list of Triangle3DElements that constitute the prism.

Definition at line 314 of file ObjectFactory.cs.

◆ CreateRectangle() [1/2]

static List< Element3D > VectSharp.ThreeD.ObjectFactory.CreateRectangle ( Point3D  point1,
Point3D  point2,
Point3D  point3,
Point3D  point4,
IEnumerable< IMaterial fill,
string  tag = null,
int  zIndex = 0 
)
static

Creates a quadrilater. All the vertices need not be coplanar.

Parameters
point1The first vertex of the quadrilater.
point2The second vertex of the quadrilater.
point3The third vertex of the quadrilater.
point4The fourth vertex of the quadrilater.
fillA collection of materials that will be applied to the Triangle3DElements returned by this method.
tagA tag that will be applied to the Triangle3DElements returned by this method.
zIndexA z-index that will be applied to the Triangle3DElements returned by this method.
Returns
A list containing two Triangle3DElements representing the quadrilater.

Definition at line 93 of file ObjectFactory.cs.

◆ CreateRectangle() [2/2]

static List< Element3D > VectSharp.ThreeD.ObjectFactory.CreateRectangle ( Point3D  point1,
Point3D  point2,
Point3D  point3,
Point3D  point4,
NormalizedVector3D  point1Normal,
NormalizedVector3D  point2Normal,
NormalizedVector3D  point3Normal,
NormalizedVector3D  point4Normal,
IEnumerable< IMaterial fill,
string  tag = null,
int  zIndex = 0 
)
static

Creates a quadrilater, specifying the vertex normals at the four vertices. All the vertices need not be coplanar.

Parameters
point1The first vertex of the quadrilater.
point2The second vertex of the quadrilater.
point3The third vertex of the quadrilater.
point4The fourth vertex of the quadrilater.
point1NormalThe vertex normal at the first vertex of the quadrilater.
point2NormalThe vertex normal at the second vertex of the quadrilater.
point3NormalThe vertex normal at the third vertex of the quadrilater.
point4NormalThe vertex normal at the fourth vertex of the quadrilater.
fillA collection of materials that will be applied to the Triangle3DElements returned by this method.
tagA tag that will be applied to the Triangle3DElements returned by this method.
zIndexA z-index that will be applied to the Triangle3DElements returned by this method.
Returns
A list containing two Triangle3DElements representing the quadrilater.

Definition at line 123 of file ObjectFactory.cs.

◆ CreateSphere()

static List< Element3D > VectSharp.ThreeD.ObjectFactory.CreateSphere ( Point3D  center,
double  radius,
int  steps,
IEnumerable< IMaterial fill,
string  tag = null,
int  zIndex = 0 
)
static

Creates a sphere.

Parameters
centerThe centre of the sphere.
radiusThe radius of the sphere.
stepsThe number of meridians and parallels to use when generating the sphere.
fillA collection of materials that will be applied to the Triangle3DElements returned by this method.
tagA tag that will be applied to the Triangle3DElements returned by this method.
zIndexA z-index that will be applied to the Triangle3DElements returned by this method.
Returns
A list of Triangle3DElements that constitute the sphere.

Definition at line 148 of file ObjectFactory.cs.

◆ CreateTetrahedron()

static List< Element3D > VectSharp.ThreeD.ObjectFactory.CreateTetrahedron ( Point3D  center,
double  radius,
IEnumerable< IMaterial fill,
string  tag = null,
int  zIndex = 0 
)
static

Creates a tetrahedron inscribed in a sphere.

Parameters
centerThe centre of the tetrahedron.
radiusThe radius of the sphere in which the tetrahedron is inscribed.
fillA collection of materials that will be applied to the Triangle3DElements returned by this method.
tagA tag that will be applied to the Triangle3DElements returned by this method.
zIndexA z-index that will be applied to the Triangle3DElements returned by this method.
Returns
A list of Triangle3DElements that constitute the sphere.

Definition at line 238 of file ObjectFactory.cs.

◆ CreateWireframe()

static List< Element3D > VectSharp.ThreeD.ObjectFactory.CreateWireframe ( IEnumerable< Element3D >  object3D,
Colour  colour,
double  thickness = 1,
LineCaps  lineCap = LineCaps.Butt,
LineDash lineDash = null,
string  tag = null,
int  zIndex = 0 
)
static

Creates a wireframe from a collection of Element3Ds.

Parameters
object3DThe collection of Element3Ds. Line3DElements and Point3DElements are ignored.
colourThe colour of the Line3DElements returned by this method.
thicknessThe thickness of the Line3DElements returned by this method.
lineCapThe line cap of the Line3DElements returned by this method.
lineDashThe line dash of the Line3DElements returned by this method.
tagA tag that will be applied to the Line3DElements returned by this method.
zIndexA z-index that will be applied to the Line3DElements returned by this method.
Returns
A list of Line3DElements that constitute the wireframe.

Definition at line 370 of file ObjectFactory.cs.


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