Worm
A Worm is a 3d shape made up of sections, where each section has a 2d shape at each end joined by a tube. The simplest worm is an extrusion, were both ends are the same shape, parallel to the Z=0 plane (the floor), separated by the length of the extrusion.
However we can create complex 3D worm structures by adding new segments using extrude.
If we only used extrude, the the worm would always point straight upwards, but we can change its direction using bendX and bendY. If you imagine a worm digging through soil, bendX will make the worm turn left or right. bendY will make the worm tilt its head up or down. Note that these are relative to the direction that the worm is pointing. twist, as the name suggests causes the worm to twist. It will continue to point in the same direction.
A worm usually starts and end with 2d shape at both ends. However one (or both) ends could be a point, forming a conical end. There is one more option: we could join the start and ends together to make a ring (a torus / doughnut). (The worm eating its own tail).
// TODO How show how we start with a point. (not implemented) // TODO Show how we end with a point (not implemented) // TODO Show how we join the ends (not implemented)
Worms don't have to be the same shape along their length. For example, we could start with a circle of radius 10, then change the radius as we add more sections. We can also change the shape completely, making it square, or triangular etc. When we change the shape, there are many possible ways to join the points forming the tube. By default a heuristic is used to decide how the tube is formed. Sometimes this heuristic won't do what you want, in which case, you will have to intervene, and explicitly state for each point of shape A which point of shape B it connects to. But at time of writing, this hasn't been implemented!
// TODO Describe ManualJoinStrategy (not implemented)
// TODO twist may or not cause a visible twist in the tube. Should point #0 of shape A match point #0 of shape B? // twist should cause a twist. If we don't want the twist, then use Shape2d.rotate.# // twist should be applied after the points are paired up.
Properties
An optional value, which can help OpenSCAD render shapes correctly in preview mode. The stated convexity make NO DIFFERENCE to the final rendering. If the convexity is set to low (or set to null), then the preview mode may not display correctly. A large convexity may cause the OpenSCAD to update slowly / suboptimally. See OpenSCAD documentation for the definition of convexity.
Functions
Combine two shapes, so that the solid parts and cavities are both considered. If you use the more normal Shape3d.union method instead (or the plus operator), then the cavity won't be treated in a special way, and the result will be the same as if remove was not used.
The axis aligned cube which encloses this shape.
Moves the center of this shape to xyz.
Sets the colour of this shape (used only by OpenSCAD's preview mode). As with all FooCAD transformations, this returns a NEW shape, it does not modify this shape.
Takes shape toCut and removes it from this shape (using difference). toCut is moved along the Z axis by z units.
Takes shape toCut and removes it from this shape (using difference). toCut is moved along the Z axis by z units, and also by toCut.size.x * alignment
.
If this Shape is a Shape2dDependent
An operator which is the same as intersection.
Combines this shape and the other shape, such that only the places that the two shapes overlap are present in the result.
Labels a shape, so that we can collect all the important labelled shapes, and ignore the others. The PlanTarget in the construction module uses label to know which items to add to the plan.
Labels a shape, so that we can collect all the important labelled shapes, and ignore the others.
An operator which is the same as difference.
Shows as transparent in OpenSCAD's preview mode, but is NOT included in the final rendered version, and therefore will NOT be printed.
Rotate by degrees around the X axis.
Rotate by degrees around the Y axis.
Rotate by degrees around the Z axis.
Scales along the X direction only. See scale.
Scales along the Y direction only. See scale.
Scales along the Z direction only. See scale.
Uses corner to move the object to the origin.
Uses corner to move the object so that it's X value is 0 (i.e. it is just touching the X=0 plane). This is the same as leftToOrigin unless this shape has been scaled by a negative amount! See also rightToOrigin.
Uses corner to move the object so that it's Y value is 0 (i.e. it is just touching the Y=0 plane). This is the same as frontToOrigin unless this shape has been scaled by a negative amount! See also backToOrigin.
Uses corner to move the object so that it's Z value is 0 (i.e. it is just touching the Z=0 plane). This is the same as bottomToOrigin unless this shape has been scaled by a negative amount! See also topToOrigin.
Creates a plain Polyhedron from points and faces.
Applies an arbitrary transformation, which does NOT have to be an affine transformation. OpenSCAD has no equivalent, and therefore the result is always a nasty polyhedron, (or a compound of lots of polyhedrons), which makes the resulting .scad file even more unreadable than usual!
Applies an arbitrary transformation. This is equivalent to OpenSCAD's 'multmatrix'. NOTE, there is a times operator which does the same thing, which may be more readable.
Some transformations require the points and faces data. This isn't available for Union3d, Difference3d and Intersection3d, so it may seem impossible to transform a union, difference or intersection. We can though. If we pull the component parts out of the union/difference/intersection, apply the transformation to those shapes, and then recombine the results.
Translates this shape. There are lots of "syntactic sugar" variations which perform translations : translateX, translateY, translateZ, leftTo, rightTo, frontTo, backTo, topTo, bottomTo, center, centerX, centerY, centerZ, centerXY, centerXTo, centerYTo, centerZTo They all perform a translation, but can make you scripts easier to read.