Transformation2d
Properties
Imagine travelling in a straight line cutting through the shape. The convexity is the maximum number of times your will enter the shape. For square and circle, this is 1. For a convex shape with a hole, it is 2. For a shape with a single concave part, such as a banana, it is also 2.
The 2D points which define the lines around the shape. This is a list of Path2d because a shape can have holes (so there's one path for the exterior, and one path for each hole). Also, a shape can be a compound of more than one exterior shape. e.g. If we have 2 circles (like a 'colon' symbol) we can define it using a single Shape2d with two paths.
Functions
Moves the center of this shape to xy.
If this Shape is a Shape2dDependent
An operator which is the same as intersection.
Checks that this shape's paths are ordered correctly. All paths are tests to see how many of the other paths contain it. If the answer is odd, it is assumed to be a hole, and the order of the points is made clockwise. If the answer is even, then the order of the points is made anticlockwise.
Extrude a 2D shape upwards (in the Z direction) to form a 3D shape (an extrusion).
Extrude this 2D shape along a 3D path.
Extrude this 2D shape around the edge of another Shape2d (aroundShape).
Mirror along the line X=Y. i.e. the X and Y values are switched over.
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.
An operator which is the same as difference.
Uses OpedSCAD's built-in offset module to grow/shrink this 2d shape.
Shows as transparent in OpenSCAD's preview mode, but is NOT included in the final rendered version, and therefore will NOT be printed.
Create a solid of revolution. Take this object, stand it up, so that it is on the plane Y=0, and then spin it around the Z axis.
Create a solid of revolution. Take this object, stand it up, so that it is on the plane Y=0, and then spin it angle degrees around the Z axis.
Similar to roundCorner, but rounds all corners.
Creates a new shape, rounding a single corner. This assumes paths is defined, and contains a single list (i.e. is a simple polygon, with no holes).
Similar to roundCorner, but rounds any number of corners.
Convert a FooCAD Shape2d into jts Geometry.
This is here only for completeness, at time of writing, this wasn't being used.
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 touching the Y axis).
Uses corner to move the object so that it's Y value is 0 (i.e. it is touching the X axis). This is the same as frontToOrigin unless this shape has been scaled by a negative amount! See also backToOrigin.
Some operations, such as transform require the paths data. This isn't available for Union2d, Difference2d and Intersection2d, 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, everything works out fine.