Package-level declarations

Types

Link copied to clipboard
class BezierEase(x1: Double, y1: Double, x2: Double, y2: Double) : Ease

Imagine a 2D bezier curve from 0,0 to 1,1 using the intermediate points x1,y1 and x2,y2.

Link copied to clipboard
class Color(r: Float, g: Float, b: Float, o: Float)
Link copied to clipboard
annotation class Custom(val about: String = "", val min: Double = java.lang.Double.NEGATIVE_INFINITY, val max: Double = java.lang.Double.POSITIVE_INFINITY, val slider: Boolean = false, val lines: Int = 1, val fontName: Boolean = false, val additional: Boolean = false)

Tag var fields of your Model, and they will appear in the customiser. This will let you (or others) create alternate versions of the model with customised parameters values.

Link copied to clipboard
class Degrees

Trig functions, which take and return angles in degrees rather than radians.

Link copied to clipboard
interface Ease

Takes a number in the range 0..1 and returns another in the same range

Link copied to clipboard
object Eases
Link copied to clipboard
Link copied to clipboard
class Log

Note, this is a fully static class, with @JvmStatic methods, so that Feather Scripts can use these methods.

Link copied to clipboard
interface Logger
Link copied to clipboard
class Matrix2d(val x1y1: Double = 1.0, val x2y1: Double = 0.0, val x3y1: Double = 0.0, val x1y2: Double = 0.0, val x2y2: Double = 1.0, val x3y2: Double = 0.0)

Note. if this only needed for affine transformations, then the bottom row can be hard coded to 0,0,1 This will simplify the maths.

Link copied to clipboard
class Matrix3d(val x1y1: Double = 1.0, val x2y1: Double = 0.0, val x3y1: Double = 0.0, val x4y1: Double = 0.0, val x1y2: Double = 0.0, val x2y2: Double = 1.0, val x3y2: Double = 0.0, val x4y2: Double = 0.0, val x1y3: Double = 0.0, val x2y3: Double = 0.0, val x3y3: Double = 1.0, val x4y3: Double = 0.0)

Note. if this only needed for affine transformations, then the bottom row can be hard coded to 0,0,0,1 This will simplify the maths.

Link copied to clipboard
class NoFacesException(val shape: Shape3d) : Exception

Most 3D shapes do not know their Shape3d.points nor Shape3d.faces, and throw this exception when either are accessed. Most 3D shapes rely on OpenSCAD's renderer.

Link copied to clipboard
class NoPathsException(val shape: Shape2d) : Exception

Some 2d shapes, such as Union2d, Difference2d and Hull2d do not store the points which make up the shape. This exception is thrown when such a shape is used with a method that requires the point data.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class Vector2(val x: Double, val y: Double)
Link copied to clipboard
class Vector3(val x: Double, val y: Double, val z: Double)

Properties

Link copied to clipboard

Are we running on a Windows operating system?

Link copied to clipboard

Functions

Link copied to clipboard
fun <T> List<T>.barrelGet(index: Int): T
Link copied to clipboard
fun bezierTo(a: Vector2, b: Vector2, c: Vector2, d: Vector2, sides: Int): List<Vector2>
fun bezierTo(a: Vector3, b: Vector3, c: Vector3, d: Vector3, sides: Int): List<Vector3>
Link copied to clipboard
Link copied to clipboard
fun ellipticalArc(a: Vector2, b: Vector2, radius: Vector2, degrees: Double, largeArc: Boolean, sweep: Boolean): List<Vector2>

fun ellipticalArc(a: Vector2, b: Vector2, radius: Vector2, degrees: Double, largeArc: Boolean, sweep: Boolean, sides: Int?): List<Vector2>

Creates an elliptical arc from point a to point b whose radius is radius and whose x axis is rotated by degrees. See https://www.w3.org/TR/SVG11/paths.html#PathDataEllipticalArcCommands

Link copied to clipboard
Link copied to clipboard
fun max2(points: List<Vector2>): Vector2
Link copied to clipboard
fun max3(points: List<Vector3>): Vector3
Link copied to clipboard
inline fun <T> Iterable<T>.maxValue(selector: (T) -> Double): Double
inline fun <T, R : Comparable<R>> Iterable<T>.maxValue(default: R, selector: (T) -> R): R
Link copied to clipboard
fun min2(points: List<Vector2>): Vector2
Link copied to clipboard
fun min3(points: List<Vector3>): Vector3
Link copied to clipboard
inline fun <T> Iterable<T>.minValue(selector: (T) -> Double): Double
inline fun <T, R : Comparable<R>> Iterable<T>.minValue(default: R, selector: (T) -> R): R
Link copied to clipboard
Link copied to clipboard

Redirects stdout and stderr to /dev/null or NUL (windows). This prevents the process from blocking if it spews output.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun resolution(path: Path2d, res: Double): Path2d
fun resolution(shape: Shape2d, res: Double): Polygon
Link copied to clipboard
fun resolutionX(path: Path2d, res: Double): Path2d
fun resolutionX(shape: Shape2d, res: Double): Polygon
Link copied to clipboard
fun resolutionY(path: Path2d, res: Double): Path2d
fun resolutionY(shape: Shape2d, res: Double): Polygon
Link copied to clipboard
fun roundAllCorners(sourcePath: Path2d, radius: Double, sides: Int? = null): Path2d
fun roundAllCorners(shape: Shape2d, radius: Double, sides: Int? = null): Polygon
Link copied to clipboard
fun roundCorner(shape: Shape2d, cornerIndex: Int, radius: Double, sides: Int? = null): Polygon
Link copied to clipboard
fun roundCorners(shape: Shape2d, corners: List<Int>, radius: Double, sides: Int?): Polygon
Link copied to clipboard
fun Shape2d.toJTSGeometry(): Geometry

Convert a FooCAD Shape2d into jts Geometry.

Link copied to clipboard
fun Path2d.toJTSLineString(): LineString

Converts a FooCAD Path2d into a jts LineString. If the Path2d is closed, then use Path2d.toJTSPolygon instead.

Link copied to clipboard
fun Shape2d.toJTSMultiLineString(): MultiLineString

This is here only for completeness, at time of writing, this wasn't being used.

Link copied to clipboard
fun Path2d.toJTSPolygon(): Polygon

Convert a FooCAD Path2d into a jts Polygon. If the Path2d is not closed, then use Path2d.toJTSLineString instead.

Link copied to clipboard
fun Geometry.toPath2d(): Path2d?

Converts jts Geometry to a FooCAD Path2d.

Link copied to clipboard
fun Geometry.toPolygon(): Polygon

Convert jts Geometry into a FooCAD Shape2d (specifically, a Polygon).