Class CM3PathExtrusion
PathExtrusion
Creates an extruded 3d object along a path with a specified cross section.
This class is used to extrude a variety of objects including polylines.
Note: This class makes use of the tan2(y,x) function. This function is documented
as the angle in the x,y plane being from the x-axis. This is revsered because
geographers measure x,y from the y axis (north) (a.k.a. the longitude). Similarly,
we measure the angle from the x,y plane (the equator).
Lontidue=tan2(x,y)
Latitude=tan2(z,xy) - where xy is the distance in the xy plane
Latitude=sin(z/r)
Resources:
http://edwilliams.org/avform.htm#Intermediate - Ed Williams page on aviation formulas
this contains the key equation for computing segments along a great circle.
https://en.wikipedia.org/wiki/Spherical_coordinate_system - Wikipedia's spherical
coorcinate page. Remember that this is for typical geometry based calculations
and we are using geographic lats and lons so the positions of the angles are different
https://en.wikipedia.org/wiki/Atan2 - Wikipedia page on atan2(). This documentation
does not excatly match the JavaScript function as the JS function is valid for all
posible values of the angle.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2
Mizilla documatation for JS atan2 function. Again, our angles are reversed.
Settings Group: PathExtrusion
Setting |
Name |
Type |
Options |
Default |
Comments |
Type |
Type |
CMTYPE_ENUMERATED |
"Flat", "Pointy", "ThreeJS" |
Flat |
|
Smoothed |
Smoothed |
CMTYPE_BOOLEAN |
|
true |
|
Closed |
Closed |
CMTYPE_BOOLEAN |
|
false |
|
EndCap |
End Cap |
CMTYPE_ENUMERATED |
"Flat", "Open", "Pointy" |
Flat |
|
CrossSectionAngle |
Cross Section Rotation |
CMTYPE_FLOAT |
|
90 |
Angle to rotate the cross section can be rotated about its axis. This can be used to create a 2 sided cross section and then rotate it so it creates a flat surface similar to a road. |
RadiusOfRotation |
Radius Of Rotation |
CMTYPE_FLOAT |
|
40 |
Minimum radius for the path to curve. Segments that turn faster will be shortened or removed. |
DegreesPerSegment |
DegreesPerSegment |
CMTYPE_FLOAT |
|
45 |
Minimum angle in a curve before another segment is added. The lower the value, the smoother the curve but also the more complex. |
SegementsPerLine |
SegementsPerLine |
CMTYPE_INTEGER |
|
5 |
ThreeJS type places segements evenly along the extrusion so this factor if mulitplied by the number of lines in the path to smooth it out |
Object Functions
Object Functions
ComputeGeometryBisecting()
Create an extrusion along a series of line segements (path). This approach
creates tubes for each line segment where the ends of the tubes are perpendicular
to the line segments direction. The tubes will overlap at the corners and there will
be gaps on the outside of the turns. The gaps are filled with another series of surfaces.
Note: this version connects the ends by finding the bisecting plane between the vectors
on either side of the current point. This gives the long pointy extensions to the extrusion