## Chapter 103D representation

To be fully honest, TeXgraph is not a 3D drawing software, it is working with complex numbers. Though, minimal things can be done in the space:

• A point or vector with coordinates (x,y,z) is represented by the list: [x+i*y,z] or using the command M: M(x,y,z). For example the origin is M(0,0,0) or [0,0], the variable Origin also exists. It is possible to add or substract two lists, and also multiply a list by a number, ie: linear combinations. Moreover a local or global variable may contain a complexes list, then a variable A could contain a list like [x+i*y,z] representing a so called 3Dpoint or 3Dvector.
• A plane is represented by one of its points and a normal vector, ie a list: [3Dpoint, 3Dvector].
• A strait line is represented by one of its points and a direction vector, ie a list: [3Dpoint, 3Dvector].
• A facet is represented by the list of its vertices, that list is ended with the constant jump. The vertices order is crucial, defining the facet orientation. Example: face:= [Origin, M(3,0,0), M(0,3,0), jump].
• A surface or polyhedron is represented by a facet list.

There are two 3D representation types:

1. individual objects representation: in this case, the user has to manage the scene: the display order and for example the intersections. This case correspond to the options located on the 3D supplements toolbar from the graphical interface. That case is suitable if there is only one object or if the scene is very simple. Advantage of the method: the image is lightweight and kept vectorial (circles, arcs,...)
2. global scene representation: In that case, the Build3D() command is defining the scene and the Display3D() command is “calculating” the scene and displaying it. The display order and intersections are then automatically determined. The drawback is that the facets or segments number may explode resulting in a heavy image file and the vectorial aspect for some elements is lost : those are then drawn with segments (arcs, circles,...)

This chapter is dedicated to the first type, the second is described in the following one.

10.2 Commands for 3D
10.2.1 Edges
10.2.2 Outline
10.2.3 ComposeMatrix3D
10.2.4 ConvertToObj
10.2.5 ConvertToObjN
10.2.6 Clip3DLine
10.2.7 ClipFacet
10.2.8 DistCam
10.2.9 Fvisible
10.2.10 GetMatrix3D
10.2.11 GetSurface
10.2.12 IdMatrix3D
10.2.13 Insert3D
10.2.14 MakePoly
10.2.15 ModelView
10.2.16 Mtransform3D
10.2.17 Norm
10.2.18 Normal
10.2.19 PaintFacet
10.2.20 PaintVertex
10.2.21 PosCam
10.2.22 Prodvec
10.2.23 Prodscal
10.2.24 Proj3D
10.2.26 SetMatrix3D
10.2.27 Vertices
10.2.28 SortFacet

10.3.1 aire3d
10.3.2 angle3d
10.3.3 bary3d
10.3.4 det3d
10.3.5 interDD
10.3.6 interDP
10.3.7 interLP
10.3.8 interPP
10.3.9 IsAlign3D
10.3.10 isobar3d
10.3.11 IsPlan
10.3.12 KillDup3D
10.3.13 length3d
10.3.14 Merge3d
10.3.15 n
10.3.16 Nops3d
10.3.17 normalize
10.3.18 permute3d
10.3.19 planEqn
10.3.20 Pos3d
10.3.21 purge3d
10.3.22 px, py, pz, pxy, pxz, pyz
10.3.23 replace3d
10.3.24 reverse3d
10.3.25 viewDir
10.3.26 visible
10.3.27 Xde, Yde, Zde

10.4.1 antirot3d
10.4.2 defAff3d
10.4.3 dproj3d
10.4.4 dproj3dO
10.4.5 dsym3d
10.4.6 dsym3dO
10.4.7 ftransform3d
10.4.8 hom3d
10.4.9 inv3d
10.4.10 proj3d
10.4.11 proj3dO
10.4.12 rot3d
10.4.13 shift3d
10.4.14 sym3d
10.4.15 sym3dO

10.5.1 invmatrix3d
10.5.2 matrix3d
10.5.3 mulmatrix3d

10.6.1 drawWin3d
10.6.2 rectangle3d
10.6.3 RestoreTphi
10.6.4 RestoreWin3d
10.6.5 SaveTphi
10.6.6 SaveWin3d
10.6.7 transformbox3d
10.6.8 view3D

10.7.1 ScreenX
10.7.2 ScreenY
10.7.3 ScreenPos
10.7.4 ScreenCenter

10.8.1 Clip3D
10.8.2 clipCurve
10.8.3 clipPoly

10.9.1 AretesNum (edges number)
10.9.2 Chanfrein (chamfer)
10.9.3 Cone
10.9.4 curve2Cone
10.9.5 curve2Cylinder
10.9.6 curveTube
10.9.7 Cvx3d
10.9.8 Cylindre
10.9.9 FacesNum
10.9.10 getdroite (3D straight line)
10.9.11 getplan
10.9.12 getplanEqn
10.9.13 grille3d (3D grid)
10.9.14 HollowFacet
10.9.15 Intersection
10.9.16 line2Cone
10.9.17 line2Cylinder
10.9.18 lineTube
10.9.19 Parallelep
10.9.20 pqGoneReg3D
10.9.21 Prisme
10.9.22 Pyramide
10.9.23 rotCurve
10.9.24 rotLine
10.9.25 Section
10.9.26 Sphere
10.9.27 Tetra
10.9.28 trianguler (triangulation)

10.10.1 Arc3D
10.10.2 Axes3D
10.10.3 AxeX3D
10.10.4 AxeY3D
10.10.5 AxeZ3D
10.10.6 BoxAxes3D
10.10.7 Cercle3D (circle)
10.10.8 Courbe3D
10.10.9 Dcone
10.10.10 Dcylindre
10.10.11 DpqGoneReg3D
10.10.12 DrawAretes
10.10.13 DrawDdroite
10.10.14 DrawDroite
10.10.15 DrawPlan
10.10.16 Dsphere
10.10.17 LabelDot3D
10.10.18 Ligne3D
10.10.19 markseg3d
10.10.20 Point3D

10.11.1 Dparallelep
10.11.2 Dprisme
10.11.3 Dpyramide
10.11.4 DrawFacet
10.11.5 DrawFlatFacet
10.11.6 DrawPoly
10.11.7 DrawSmoothFacet
10.11.8 Dsurface
10.11.9 Dtetraedre