Package-level declarations

Types

Link copied to clipboard
class Circle(val radius: Double, val sides: Int) : Shape2d

A circle, and can also be used to form ellipses, and regular polygons.

Link copied to clipboard
open class Cube(val size: Vector3) : Shape3d
Link copied to clipboard

A Cylinder, cone or truncated cone (whose top is parallel with the bottom).

Link copied to clipboard
class FontNames
Link copied to clipboard

Horizontal alignment of Text. Used within TextStyle.

Link copied to clipboard

A general polygon from lists of points. A simple polygon has a single Path2d defining its outline. However here we have a list of paths, which can be used in two ways...

Link copied to clipboard
class Polyhedron(val points: List<Vector3>, val faces: List<List<Int>>, val convexity: Int? = null) : Shape3d

A general purpose polyhedron created by defining all the vertices (points), and how these vertices are joined to form faces.

Link copied to clipboard
class Sphere(val radius: Double, val sides: Int) : Shape3d

A sphere. Like all shapes in FooCAD, the sphere is approximated using a number of triangles. You can let FooCAD determine the number of triangles by omitting sides.

Link copied to clipboard
class Square(val size: Vector2) : Shape2d
Link copied to clipboard
class Text(val text: String, val style: TextStyle) : Shape2d, Customisable

By default, the text is rendered by OpenSCAD. However, sometimes we want to know the size of this shape (e.g. when using center). So we sometimes need to render the text within FooCAD too. This can cause problems, because the two font rendering system are different, and can give quite different results. In particular the size as reported by FooCAD is often slightly wrong compared with the actual size seen within OpenSCAD.

Link copied to clipboard

Text direction, currently only left to right, and right to left are supported. Note OpenSCAD also support top to bottom and bottom to top. These may be added at a later date. Get in touch if you care about these other directions.

Link copied to clipboard
class TextStyle(val fontName: String, val fontSize: Float = 10.0f, val hAlign: HAlignment = HAlignment.LEFT, val vAlign: VAlignment = VAlignment.BASELINE, val spacing: Double = 1.0, val direction: TextDirection = TextDirection.LTR, val lineSpacing: Double = 1.0, val color: Color? = null) : Customisable

A TextStyle allows you to define a style, and then use it for many Text objects, which cuts down on duplicate code.

Link copied to clipboard

Vertical alignment of Text. Used within TextStyle.

Properties

Link copied to clipboard