Godot API
The Godot wrappers over the cadaclysm library: the reader reads, meshes and writes; the kernel builds exact solids. Every type and call, with the signature as the wrapper declares it — read from its source when this page is built.
Install and load
The addon, addons/cadaclysm/: a GDExtension for Godot 4.4 and later, prebuilt in every SDK release as cadaclysm-<version>-godot.zip for Windows x64, macOS 11+ (universal) and Linux x64 and arm64. Copy its addons/cadaclysm/ into the project: there is no plugin to enable, and the classes are there in GDScript. To build it yourself, the SDK's godot/ folder holds its Rust source (Rust 1.94 or later) and build.py; see the Godot page. The classes are Python's, name for name, with Cadaclysm in front — CadaclysmScene, CadaclysmSolid — and Python's module functions are static functions of Cadaclysm (the reader) and CadaclysmBlacksmith (the kernel). Properties are read-only properties here too; Godot's own types stand in where Godot has one: a Transform3D, an AABB, a Color, an ArrayMesh. Files open Y up in metres, Godot's own space, unless asked otherwise.
The addon carries the libraries, in bin/<platform>/ beside the extension; an exported game gets them beside its executable, copied there by the .gdextension file. Building the addon from the SDK's godot/ folder is on the Godot page.
# addons/cadaclysm/ copied into the project; then, from any script:
func _ready() -> void:
print(Cadaclysm.version(), " ", CadaclysmBlacksmith.version())
Where the library is found
Beside the extension: the addon's bin/<platform>/, or next to an exported game's executable. CADACLYSM_LIBRARY for the reader and CADACLYSM_BLACKSMITH_LIBRARY for the kernel, each a file or a directory, name others and win over those; past that the SDK's own search runs (beside the executable, a lib/ in any parent). Cadaclysm.library_path() says which was used, and Cadaclysm.load(path) names one outright.
The licence
Unlicensed, everything works and a notice is printed on every open and export. A licence file removes it: set CADACLYSM_LICENSE, or put cadaclysm.lic beside the executable or in the working directory, or load it from code with either line below: one call covers the whole library (the two separate libraries of earlier releases need both).
Cadaclysm.license("res://cadaclysm.lic")
CadaclysmBlacksmith.license("res://cadaclysm.lic")
Build a part, then read it back
The kernel builds a plate with a boss, bores it and rounds its corners, then writes STEP — the Examples page's first part:
# Run headless from the project's folder: godot --headless --script plate.gd
extends SceneTree
func _initialize() -> void:
var plate := CadaclysmWorkplane.xy().extrude(CadaclysmProfile.rect(120, 80), 14).solid()
var boss := CadaclysmWorkplane.from_solid(plate) \
.faces(">Z").workplane() \
.extrude(CadaclysmProfile.circle(22), 26).solid()
var part := plate.join(boss)
var bore := CadaclysmWorkplane.xy().extrude(CadaclysmProfile.circle(11), 60).solid().translate(0, 0, -10)
part = part.cut(bore)
# The plate's four vertical corners: the lines along Z between two planes
# (the boss has vertical seams too, but those lie on its cylinder).
var corners := []
for edge: CadaclysmEdge in part.edges:
if edge.is_line and absf(edge.direction.z) > 0.99 \
and Array(edge.faces).all(func(f): return part.face_kind(f) == "plane"):
corners.append(edge)
part = part.fillet(corners, 12)
part.step("plate.stp")
quit()
The reader opens that file, walks its tree, meshes what it draws and writes glTF:
# Run headless from the project's folder: godot --headless --script read_plate.gd
extends SceneTree
func _initialize() -> void:
var scene := CadaclysmScene.open("plate.stp") # Y up, in metres: Godot's own space
if scene == null:
push_error(Cadaclysm.last_error())
quit(1)
return
print(scene.schema, " ", scene.metres_per_unit, " m per unit")
# The tree: assemblies, parts and bodies, parents before children.
for node: CadaclysmNode in scene.walk():
print(" ".repeat(node.depth), node.label, " [", node.kind, "]")
# What to draw: every placement of every shape, meshed on first ask.
for placement: CadaclysmPlacement in scene.placements:
var mesh := placement.geometry.mesh
print(placement.geometry.label, " ", mesh.triangle_count, " triangles")
scene.save("plate.glb", "glb")
scene.close()
quit()
Reading, meshing, writing
Module functions
Loading the library, the licence, and opening a file — from disk or from bytes already in memory. Every other object on this page comes out of CadaclysmScene.open() or CadaclysmScene.open_bytes().
CadaclysmScene.open()
static func open(path: String) -> CadaclysmScene
Open a CAD file and read its tree. The format comes from the extension (a .zip or .stpZ opens its first readable member — CadaclysmScene.source_name says which — and a .gz is read as the format named before it, part.step.gz as .step). The tree is read now and the geometry is built lazily, node by node, when it is first asked for.
convention is the space to read into — a Convention, optionally with the file-units and world-UV flags — and the library converts everything it hands back into it. schema names an extra EXPRESS schema (.exp, or a directory of them); every schema the SDK ships is already built in, so it is needed only for one the library does not carry. colours asks for per-vertex colours on bodies the file painted in more than one colour.
Never returns an empty handle: on failure it returns null, false or an empty value (the reason in Cadaclysm.last_error()) carrying the library's reason.
Takes the path alone and reads Y up in metres, Godot's own space; open_with takes the rest as a Dictionary (under Scene). GDScript has no exceptions, so a failure is null: check for it.
CadaclysmScene.open_bytes()
static func open_bytes(data: PackedByteArray, format: String, options: Dictionary) -> CadaclysmScene
Open a file already in bytes — a download, a database blob, an archive member. With no file name to take the format from, it is named as an extension would name it: step, ifc, igs, 3dm, brep, scad, 3mf, ply (a leading dot is fine). The bytes are copied; the buffer can be reused as soon as this returns. Otherwise as CadaclysmScene.open().
options as open_with takes them, plus name: what the scene reports as its path.
Cadaclysm.version()
static func version() -> String
The version of the library actually loaded — the one worth reporting in a bug.
Cadaclysm.flavour
Which library is loaded: "full", "kernel-reader" or "reader" for a flavour of the single cadaclysm library ("kernel" has no reader to ask), and "reader" for the separate cadaclysm_capi of earlier releases. A call the loaded flavour does not have returns null, false or an empty value (the reason in Cadaclysm.last_error()) naming the flavour and its features, and saying the full flavour has it.
Not in the Godot add-on yet.
Cadaclysm.features
The features the loaded library was built with, comma-separated — "nodes,kernel,write-breps,write-meshes,bim,parts" for the full flavour, "nodes,write-meshes" for the reader — and empty for the separate cadaclysm_capi.
Not in the Godot add-on yet.
Cadaclysm.build_date()
static func build_date() -> String
When the loaded library was built, YYYY-MM-DD. A licence covers every build dated on or before its expiry.
Cadaclysm.license()
static func license(text_or_path: String) -> bool
Load a licence: the certificate text, or the path of a file holding it. Without this call the library looks in the CADACLYSM_LICENSE environment variable, then for cadaclysm.lic beside the executable and in the working directory. On a licence that does not verify it returns null, false or an empty value (the reason in Cadaclysm.last_error()) with the reason, and the previous licence (if any) stays in use.
Cadaclysm.license_info()
static func license_info() -> String
One line about the licence in use — customer=… expiry=… scope=… — or unlicensed (unlicensed -- <reason> when a licence was found but did not verify). Never null.
Cadaclysm.license_notice_count()
static func license_notice_count() -> int
How many unlicensed notices the library has printed to stderr in this process. An application with no console to watch (a GUI, a game) can poll this and show its own banner.
Cadaclysm.mesh_formats()
static func mesh_formats() -> Array[Dictionary]
Every mesh format CadaclysmNode.save_mesh() writes, with its file extension and a label for a save menu: stl (STL (binary)), stl-ascii (writes .stl too), msh (Gmsh), glb, gltf, obj, usda, 3mf (3D Manufacturing Format), ply (PLY (binary)) and ply-ascii (writes .ply too) in this release. Build the menu from this list rather than hard-coding it, and a format added to the library appears without a code change.
Cadaclysm.lod_levels
How many coarser levels CadaclysmNode.mesh_lod offers above the mesh itself (level 0): 3 in this release.
The C API and the other wrappers have it.
Cadaclysm.formats
Every format this build reads, each with the file extensions it takes — what an open dialog's filter is built from, the way Cadaclysm.mesh_formats() feeds a save menu.
The importer registers every readable extension with the editor itself.
Cadaclysm.datetime_of
A schedule date (seconds since 1970-01-01T00:00, as CadaclysmWorkSchedule.at() and CadaclysmTaskTime give them) as a naive datetime.
Seconds since 1970-01-01T00:00, no zone: Time.get_datetime_string_from_unix_time(int(seconds)).
Cadaclysm.seconds_of
A naive datetime as a schedule date: seconds since 1970-01-01T00:00, the inverse of Cadaclysm.datetime_of.
Seconds since 1970-01-01T00:00, no zone: Time.get_datetime_string_from_unix_time(int(seconds)).
Cadaclysm.pick_save
Ask the user where to save, through the platform's own dialog, with suggested_name prefilled. null when they cancel or no dialog is available. Blocks until the user acts; on macOS call it from the main thread.
Not in the Godot extension: Godot's own FileDialog picks a file.
Cadaclysm.pick_file
Ask the user for a file through the platform's own open dialog, filtered to what this build can read. null when they cancel or no dialog is available (on Linux, neither an XDG portal nor zenity). Blocks until the user acts; on macOS call it from the main thread.
Not in the Godot extension: Godot's own FileDialog picks a file.
Cadaclysm.declared_schema()
static func declared_schema(path: String) -> String
The schema a STEP or IFC file says it speaks (its FILE_SCHEMA line), read from the first few kilobytes — cheap even on a very large file. Empty when it names none.
Cadaclysm.resolve_schema
Which .exp of a schema directory matches a model: the chosen file, or — when the file's declared name resembles none of them — the whole list as fallbacks to try in turn. CadaclysmScene.open() does this itself when given a directory; this is for a caller that wants to report the choice.
Not in the Godot extension: pass the directory as open_with's schema and it chooses.
Cadaclysm.library_path()
static func library_path() -> String
Where the shared library was found: CADACLYSM_LIBRARY (a file or a directory) first, then beside the wrapper, then a lib/ directory in any parent (the SDK's layout).
Cadaclysm.NONE
The node index the C API uses for "no such node" (CADACLYSM_NONE, 0xFFFFFFFF). The wrappers turn it into null where a node may be missing (CadaclysmNode.parent, CadaclysmNode.instance_of), so it matters only when reading raw indices.
Missing nodes are null.
last_error Godot only
static func last_error() -> String
Why the last cadaclysm call that failed failed, reader or kernel; "" after a call that worked. GDScript has no exceptions: a failing call returns null (or false, -1 or an empty value) and reports the reason with push_error as well. Kept per thread.
load Godot only
static func load(path: String) -> bool
Load the reader library from a path before anything else asks for it. Optional: the extension finds it beside itself, as described under Install.
The importer Godot only
class CadaclysmImporter extends EditorSceneFormatImporter
class CadaclysmEditorPlugin extends EditorPlugin
The editor side: with the addon in a project, a STEP, IGES, IFC, 3dm, SAT, OCCT .brep or OpenSCAD file imports as a scene, the way a .glb does — a MeshInstance3D a body, Y up in metres. The Import dock's cadaclysm/ options add the edges, nest the file's tree, draw both sides of faces or add world-scale UVs. Nothing to call: the plugin registers the importer, and the imported scene is Godot's own, so an exported game draws it with no cadaclysm library.
CadaclysmScene
class CadaclysmScene extends RefCounted
An open document. Close it when done — CadaclysmScene.close(), or let the language's scope do it (with, using, defer, try-with-resources). Everything it hands back borrows from it: node handles, meshes, polylines. See Lifetimes for what survives a close.
CadaclysmScene.close()
func close() -> void
Give the document back. Idempotent. Every mesh and polyline view still held reads freed memory afterwards (the wrappers that can tell refuse to read them). Node and Godot hand back copies, so nothing of theirs goes stale here.
CadaclysmScene.path
var path: String # read-only
The file it was read from, or the name given to CadaclysmScene.open_bytes().
CadaclysmScene.schema_path
The .exp actually used, or null — worth reporting when a directory was passed.
Not in the Godot extension.
CadaclysmScene.convention
var convention: int # read-only
The convention it was opened with. Nothing the library hands back says what space it is in, and every array out of this scene is in this one.
An int: the number Cadaclysm.convention(name) gives for the convention's name.
CadaclysmScene.schema
var schema: String # read-only
The schema the file named, or empty for a format that names none.
CadaclysmScene.schema_read
var schema_read: String # read-only
The schema that actually read it. A file declaring a release candidate reads under the finished schema of the same version where that is what is built in; a file whose schema is unknown reads under the one that defines its entity types.
CadaclysmScene.substituted
var substituted: bool # read-only
Whether something other than the file's own schema read it — CadaclysmScene.schema and CadaclysmScene.schema_read differ.
CadaclysmScene.metres_per_unit
var metres_per_unit: float # read-only
What one length unit in the file is worth in metres; 1 where the file did not say.
CadaclysmScene.tolerances
var tolerances: Dictionary # read-only
What the file declares about its own precision, as Tolerances: the absolute tolerance in the file's own unit (beside CadaclysmScene.metres_per_unit, whatever convention the scene was opened into) and the angular one in radians, each none where the file did not say — a 3dm's units and tolerances, STEP's uncertainty, SAT's resabs, IGES's resolution; other formats declare nothing. Each body read from the file carries a copy, which the kernel's verbs given no tolerance work from.
CadaclysmScene.bounds
var bounds: AABB # read-only
Everything the model covers, in world coordinates — the one figure not in a node's own frame. This meshes the whole model, being the only way to know how far it reaches; to frame a view quickly, use the bounds of the nodes already built.
CadaclysmScene.bounds64
CadaclysmScene.bounds in double precision, in world coordinates: the model's extent unnarrowed, exact far from the origin. This meshes the whole model, as CadaclysmScene.bounds does.
Godot's geometry is single precision; the Rust SDK it is built on has it.
CadaclysmScene.diagnostics
var diagnostics: PackedStringArray # read-only
What the file held that the reader could not build, one line each.
CadaclysmScene.links
var links: Array[CadaclysmLink] # read-only
The rigid bodies of the file's mechanism, in the file's order: each names the nodes that move together. Empty for a file that records none.
CadaclysmScene.joints
var joints: Array[CadaclysmJoint] # read-only
The connections between those links, in the file's order; each names, through CadaclysmJoint.pair, how it moves.
CadaclysmScene.states
var states: Array[CadaclysmState] # read-only
The file's named mechanism poses, in file order, each a CadaclysmState. Empty for a file that records none.
CadaclysmScene.sequences
var sequences: Array[CadaclysmSequence] # read-only
The file's motion sequences — INTERPOLATED_CONFIGURATION_SEQUENCE, a mechanism moving through its states — in file order, each a CadaclysmSequence. Empty for a file that records none.
CadaclysmScene.schedules
var schedules: Array[CadaclysmWorkSchedule] # read-only
The file's work schedules (IFC 4D: IfcWorkSchedule and the tasks it controls), in file order, each a CadaclysmWorkSchedule. Empty for a file that records none.
CadaclysmScene.calendars
var calendars: Array[CadaclysmWorkCalendar] # read-only
The file's work calendars (IFC 4D: IfcWorkCalendar), in file order, each a CadaclysmWorkCalendar. A task's CadaclysmTask.calendar_index indexes this list. Empty for a file that records none.
CadaclysmScene.base
var base: CadaclysmLink # read-only
The link the file declares as the mechanism's base, or null when it declares none.
CadaclysmScene.pose()
func pose(values: Array[CadaclysmStateValue], ground: CadaclysmLink) -> CadaclysmPose
The mechanism posed by values — rows of a joint and one number per freedom of its pair, in the pair's freedom order, exactly CadaclysmState.values's row type — with ground (a CadaclysmLink, or null for the default ground: the declared CadaclysmScene.base, else the link on the most joints) held fixed. Values outside a freedom's range are used as given and reported in the answer's CadaclysmPose.out_of_range. returns null, false or an empty value (the reason in Cadaclysm.last_error()) on a bad row or a file with no mechanism, carrying the library's own message.
CadaclysmScene.pose_state()
func pose_state(state: CadaclysmState, ground: CadaclysmLink) -> CadaclysmPose
The mechanism posed by a named CadaclysmState's values, ground held fixed as CadaclysmScene.pose() does. returns null, false or an empty value (the reason in Cadaclysm.last_error()) as CadaclysmScene.pose() does.
CadaclysmScene.geometry_diagnostics
What the reader built but the geometry stage could not finish — a face that would not trim, a surface that would not mesh — one line each. CadaclysmScene.diagnostics is what the *file* held that could not be read; this is what the geometry did.
The C API and the other wrappers have it.
CadaclysmScene.source_name
var source_name: String # read-only
The archive member this was read from, or null for a plain file.
"" for a plain file.
CadaclysmScene.nodes
var nodes: Array[CadaclysmNode] # read-only
Every node, in index order: assemblies, shapes, layers, storeys — structure as well as geometry. To draw, iterate CadaclysmScene.placements instead.
CadaclysmScene.roots
var roots: Array[CadaclysmNode] # read-only
The nodes nothing else contains: where a tree view starts.
CadaclysmScene.walk()
func walk() -> Array[CadaclysmNode]
Every node reachable from the roots, parents before children.
CadaclysmScene.query()
func query(filter: String) -> Array[CadaclysmNode]
The indices of the nodes a filter matches, in document order. The filter is one boolean expression in the query language — class == ON_Brep and within(name == Walls). A filter that does not parse returns null, false or an empty value (the reason in Cadaclysm.last_error()) with the parser's message and position; one that matches nothing is an empty result, not an error.
Returns the matching nodes.
CadaclysmScene.placements
var placements: Array[CadaclysmPlacement] # read-only
What the document draws, and where. Not the nodes: a block or an instanced part is one node of geometry drawn at several places, and a node walk draws it once at its definition's frame. Iterate this to draw, and the nodes to build a tree. See CadaclysmPlacement.
CadaclysmScene.realize_all()
func realize_all() -> int
Build every mesh now, across all cores, and return how many were built. Reading is lazy so a tree can be on screen while the shapes are still coming; asking node by node meshes on one core, this uses them all. Watch it from another thread with CadaclysmScene.realized and CadaclysmScene.realize_total; stop it with CadaclysmScene.cancel().
CadaclysmScene.realize_meshes
CadaclysmScene.realize_all(), leaving alone every node that carries surfaces when skip_surfaced is true (the default): a renderer drawing those parts from their surfaces never pays for their triangles, and takes their bounds from CadaclysmNode.bounds, which falls back to the surfaces.
The C API and the other wrappers have it.
CadaclysmScene.realized
var realized: int # read-only
How many nodes CadaclysmScene.realize_all() has finished. Safe to read from another thread.
CadaclysmScene.realize_total
var realize_total: int # read-only
How many it will build in all; zero until it starts.
CadaclysmScene.cancel()
func cancel() -> void
Ask a running CadaclysmScene.realize_all() to stop. One-way for the life of the scene: later calls return at once, and meshes are still built one node at a time on request.
CadaclysmScene.forget_meshes
Drop every mesh the scene has built and give the memory back; the next ask rebuilds. For a viewer that has uploaded what it needs. What it frees is the document's own mesh, which CadaclysmNode.mesh64 lends: a view from before it points at freed memory afterwards, so the scene counts its forgets and a Mesh64 read after one is refused as a stale view rather than read. CadaclysmMesh, CadaclysmPolylines and the Béziers are the library's own caches, which a forget does not touch and which stay good until CadaclysmScene.close(); Node and Godot hand back copies, unaffected by either.
The C API and the other wrappers have it.
CadaclysmScene.save()
func save(path: String, format: String) -> bool
Write the whole scene: glb (binary glTF), gltf (text glTF, one file), obj (every placement baked to its own named object, with a .mtl beside it when anything has a colour), usda (an OpenUSD text layer: each shape's triangles once, every placement a prim referencing them, and a node's MaterialX or MDL material — its ExternalStyle.* or MaterialReference.* properties — bound in its own format over a preview of its colour), 3mf (a 3MF package: each shape an object once, every placement a build item with its world matrix, a colour per object), ply (binary little-endian) or ply-ascii (PLY has no tree: every placement baked through its world matrix into one body, a colour a vertex where anything has one), or 3dm (a Rhino file, version 8: each body as its exact brep where the file kept one and as its mesh otherwise, a shape drawn in several places once as a block with a reference at each, layers, names and colours kept; written in the file's own units and axes, so it needs a scene opened in the native convention). Every placement of every shape, named and placed as the tree is, one material per colour; in the scene's convention (use Y-up metres for the space glTF specifies; a USD layer states its up axis and metres per unit). A mechanism moves: in glTF each moving link hangs under a pivot node on its joint, in USD each link is a UsdPhysics rigid body — its mass and inertia summed from its parts at their declared density (water's where the file declares none), its parts colliding in convex pieces — and each pair a joint prim (for a simulator such as Isaac Sim); glb-skinned, gltf-skinned and usda-skinned write it as a skin instead, one bone per link (a UsdSkel skeleton in USD), for engines that move skeletal meshes only. A format outside these, or a failed write, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmScene.surface_matrix
var surface_matrix: Transform3D # read-only
The 4×4 that puts CadaclysmNode.surfaces into the space everything else is already in. Meshes and polylines arrive in the scene's convention; surfaces arrive in the file's own frame, because converting a surface means converting its parameter space too. Identity for a document opened in its native convention and units.
CadaclysmScene.show
Draw every visible placement — each block instance where the file puts it — with the viewer in use. Keywords: view= (front, back, left, right, top, bottom, iso), az=, el=, zoom=, up= (default from the convention the scene was opened with), edges= (the B-rep edges over the shapes; on the terminal library, edges=False also hides free curves — the two share one layer there), width=, height=, hint=. No tolerance=: a document is drawn at the tolerance it was read with. With the GPU library (import cadaclysm.view.wgpu) the drawing replaces what one shared window shows and stays live — at the REPL, in IPython and in Jupyter by themselves, in a script until it exits; cadaclysm.view.View draws several items or several windows.
Comes with the viewers follow-up.
CadaclysmScene.view
Orbit the model with the viewer in use; returns the camera where it was left — a dict of eye, target, up, orthographic, azimuth and elevation — and pick, what was last clicked (item, node, face) or None. A fresh window, run until closed, with the GPU library.
Comes with the viewers follow-up.
CadaclysmScene.svg()
func svg(path: String) -> bool
Every visible placement's wireframe as SVG, from a camera the keywords describe rather than a viewer window: view= (front, back, left, right, top, bottom, iso — CadaclysmScene.show's own table), az=/el= over it, up= (default from the convention this scene was opened with), fov= (0, the default, is orthographic), size= (width, height), margin= (fraction of the content's extent left each side), tolerance= (how far a written curve may stray, in page units), stroke= and background= ("#rgb", "#rrggbb" or a CSS colour name in every language, beside that language's own numeric form; background= null for transparent), width= (the stroke's, in page units), edges=, curves=, isocurves=, polylines= (which line sets are drawn; edges by default), and silhouettes= (also draw where each solid's surfaces turn away from the eye — the outline a sphere has no edge for, on by default: a sphere's and a torus's only curves are the seams where their one face meets itself, which are not edges of the body and are never drawn, so without it those two draw a blank page. A line set in its own right, so silhouettes= with edges= off draws the outline alone).
The SVG *is* the drawing, not a picture of one: with path, this writes it to the file and returns null; without, it returns the SVG text instead of writing anything. returns null, false or an empty value (the reason in Cadaclysm.last_error()) on a refused option (naming the field) or a failed write.
open_with Godot only
static func open_with(path: String, options: Dictionary) -> CadaclysmScene
CadaclysmScene.open() with Python's keyword arguments as a Dictionary: convention (a name — "y-up", the default, "native", "unreal", "unity", "blender", with "+file-units" to keep the file's units — or a number), uv_world, colors, schema (an extra .exp), source_metres_per_unit and lightmap_resolution (a lightmap atlas that many texels on a side, 0 for none, read back as CadaclysmNode.lightmap_uvs). An unknown key fails, naming the known ones. res:// and user:// paths work, in an exported game too, where a file inside the pack is read through FileAccess.
node Godot only
var node_count: int # read-only
func node(index: int) -> CadaclysmNode
The node count, and one node by index without building the list of all of them; null past the end.
instantiate Godot only
func instantiate() -> Node3D
func instantiate_with(options: Dictionary) -> Node3D
The whole scene as Godot nodes: a Node3D holding a MeshInstance3D for every placement, the bodies drawn more than once sharing one ArrayMesh, in the file's colours. Each instance carries its file node's index as metadata: cadaclysm_node (what a click selects), cadaclysm_geometry and cadaclysm_placement. instantiate_with's options: edges (each body's edges as a lines child), edge_color (a Color or colour text), material (one Material for every body), tree (nest the placements under Node3Ds following the file's tree) and double_sided. The meshes are Godot's: they outlive CadaclysmScene.close().
drawing Godot only
func drawing(view: String) -> Dictionary
Every edge and free curve seen from view — "front", "top", "left", "right", "back" or "bottom" — flattened onto the page for 2D drawing: {segments, lo, hi}, segments a PackedVector2Array of point pairs for draw_multiline, lo and hi its bounds, y down the screen.
svg_text and svg_with Godot only
func svg_text() -> String
func svg_text_with(options: Dictionary) -> String
func svg_with(path: String, options: Dictionary) -> bool
CadaclysmScene.svg() split as GDScript has no keyword arguments: svg_text()/svg(path) take every default, svg_text_with(options)/svg_with(path, options) take the keywords as a Dictionary — the same keys CadaclysmScene.svg() lists. "" (or false) on a refused option or a failed write, the reason in Cadaclysm.last_error().
CadaclysmNode
class CadaclysmNode extends RefCounted
One node of the document — an assembly, a part, a body, a layer, a placement. A handle, not a snapshot: each property asks the scene when read, so nothing goes stale and nothing is built that is never looked at. Names and attributes are cheap; CadaclysmNode.bounds and CadaclysmNode.mesh build the geometry.
CadaclysmNode.index
var index: int # read-only
Its index in the scene, stable while the scene is open: a key for a map of what has been uploaded.
CadaclysmNode.id
var id: String # read-only
What the file calls it: a STEP #N, an IFC GlobalId, a Rhino object id.
CadaclysmNode.kind
var kind: String # read-only
Its type in the file: an IFC class, an openNURBS class, a STEP shape kind.
CadaclysmNode.label
var label: String # read-only
Something to put in a tree row: the name, else the kind, else #index.
CadaclysmNode.generator
var generator: String # read-only
What its geometry was before it was triangles — brep, mesh, csg — or empty for a node that draws nothing.
CadaclysmNode.visible
var visible: bool # read-only
Whether the file says to show it when opened. The node's own switch, not inherited; true where the format has no such switch.
CadaclysmNode.visible_now
var visible_now: bool # read-only
CadaclysmNode.visible with every ancestor consulted: a layer switched off hides what hangs under it.
CadaclysmNode.locked
var locked: bool # read-only
Whether the file says it cannot be selected or edited (Rhino's lock, own or by layer). A locked node is still drawn.
CadaclysmNode.parent
var parent: CadaclysmNode # read-only
The node containing this one, or null for a root.
CadaclysmNode.children
var children: Array[CadaclysmNode] # read-only
The nodes directly under this one.
CadaclysmNode.instance_of
var instance_of: CadaclysmNode # read-only
The node whose geometry this one places, or null. A part placed seventy times is one mesh and seventy transforms; this is how a caller knows to upload it once.
CadaclysmNode.select_as
var select_as: CadaclysmNode # read-only
What a click on this node's geometry should select — usually itself. Formats that hang geometry under the object it belongs to (an IFC representation under its product) point back at the object.
CadaclysmNode.attributes
var attributes: Array[Dictionary] # read-only
Everything the file said about the node, as Attribute values.
Three keys are this library's own, put there by the STEP reader where the file states a body's geometric validation properties: Validation.StatedArea and Validation.StatedVolume, each one number, and Validation.StatedCentroid, a list of three. They are in the document's own length unit — mm and mm² and mm³ on a millimetre part — not SI. They are the sender's claim about the geometry, not a measurement of it: a receiver measures the body itself (CadaclysmSolid.mass() on CadaclysmSolid.from_node()) and compares, and a difference is evidence about the transfer. CadaclysmBlacksmith.set_option()'s step.validation_properties writes them on the way out. Every other key is whatever the file itself carried, and is not documented here.
CadaclysmNode.can_mesh
var can_mesh: bool # read-only
Whether the node has geometry of its own to draw. Builds nothing; most nodes are structure and answer false.
CadaclysmNode.colour
var colour: Variant # read-only
The colour the file gave it as RGBA in 0–1, or null — most STEP files carry none, and the caller's default is the right answer.
CadaclysmNode.transform
var transform: Transform3D # read-only
Where the node's geometry sits: a 4×4 in double precision, composed through every frame above it. Meshes stay single precision in their own frame under a double transform, so a model at survey coordinates keeps its millimetres.
A Transform3D, which a standard Godot build holds in single precision; raw_transform keeps the doubles.
CadaclysmNode.raw_transform
var raw_transform: PackedFloat64Array # read-only
The same matrix as 16 numbers in the C API's column-major order, ready for a GPU uniform.
CadaclysmNode.bounds
var bounds: AABB # read-only
The extent of the node's geometry in that geometry's own frame. Builds the geometry if needed; carry it through CadaclysmNode.transform for world coordinates.
CadaclysmNode.bounds64
CadaclysmNode.bounds in double precision: the node's extent in that geometry's own frame, unnarrowed — exact far from the origin, where CadaclysmNode.bounds's float32 corners are not. Builds the geometry if needed.
Godot's geometry is single precision; the Rust SDK it is built on has it.
CadaclysmNode.mesh
var mesh: CadaclysmMesh # read-only
Its triangles in their own frame, built now if they have not been. A node that instances another hands back the instanced node's arrays — the same memory for every placement. The arrays are views into the scene — copies in Node and Godot; see Lifetimes.
Copied out of the scene, into a CadaclysmMesh of packed arrays. array_mesh() builds Godot's ArrayMesh without the copy.
CadaclysmNode.mesh64
CadaclysmNode.mesh in double precision: the document's own mesh, lent rather than narrowed — the same indices, CadaclysmNode.mesh's positions being exactly these rounded. For a mesh used as geometry (an exporter, a measurement, a solver) far from the origin, where float32 cannot hold the file's coordinates. Where the wrapper hands out views over the scene's memory, forgetting the scene's meshes invalidates them — these lend the document's own mesh, where the float mesh is a copy the library keeps and a forget leaves alone; asked again it is built again. Each one is stamped with the scene's forget count, so reading its arrays after a forget raises a stale view rather than reading freed memory — an array already taken out of it before the forget is not caught.
Godot's geometry is single precision; the Rust SDK it is built on has it.
CadaclysmNode.fem_mesh()
func fem_mesh(tolerance: float = 0.01, max_size: float = 0.0) -> CadaclysmFemMesh
func fem_mesh_placed(tolerance: float, max_size: float, placement: Variant) -> CadaclysmFemMesh
Its body meshed for a solver, as a CadaclysmFemMesh: nodes welded by bits — two mesh points are one node only where their coordinates are the same doubles, so no tolerance ever merges two distinct points and a crack stays a crack — triangles wound outward, and every node tagged with the lowest-dimension B-rep entity it lies on. Meshed in the part's own frame, following the hop from an instance to the shape it draws that CadaclysmNode.mesh follows, so a node instanced six times meshes once.
tolerance is the chordal tolerance in model units, and it alone governs how closely the mesh follows the geometry. max_size is a size ceiling, 0 for none (curvature alone): it splits boundary segments to at most that length and lays interior stations max_size / √2 apart as a target, and it adds nodes without refining the boundary geometry — a caller that wants the rim nearer its curve lowers the tolerance, where max_size only makes the elements smaller. CadaclysmFemMesh.longest_edge is what the mesh actually came to, and the figure to check.
placement is sixteen numbers, in CadaclysmPlacement.raw_transform's own column-major order — which CadaclysmNode.bounds_placed takes too, in the wrappers that have it — applied in double precision throughout. The kernel's CadaclysmSolid.fem_mesh() takes twelve instead — an origin and three axes — so a caller moving between the two reformats the placement.
The space is the body's own for a B-rep and the scene's for a mesh, which CadaclysmFemMesh.from_mesh is the flag for: under a convention other than the native one those are two different spaces, and mixing these nodes with CadaclysmNode.transform without reading it gives a rotated part.
A cracked body is not a failure: it comes back with CadaclysmFemMesh.watertight false and its cracks in CadaclysmFemMesh.open_edges and CadaclysmFemMesh.folded_edges, and nothing is welded shut to make it look sound. It returns null, false or an empty value (the reason in Cadaclysm.last_error()) for a tolerance or size the mesher refuses, a placement that is not sixteen finite and invertible numbers, a node with neither a B-rep nor a mesh (an assembly, a storey, a layer, a curve), and a body that meshes to no triangles at all.
The unlicensed notice is printed here, once, and on neither of the two .msh calls — where the kernel library is the other way round. Read CadaclysmFemMesh.msh_text() before porting either convention onto the other side.
Takes tolerance and max_size alone, both defaulted; fem_mesh_placed(tolerance, max_size, placement) is the same call with a placement — a Transform3D, or sixteen numbers column-major (a PackedFloat64Array or an array, which keep a double where a Transform3D holds floats — CadaclysmNode.raw_transform is sixteen such numbers in that same order). The length is checked there, the ABI being handed only a pointer. Two entry points rather than one optional argument because Godot has no null default for one, as open/open_with are two. GDScript has no exceptions, so a failure is null: check for it.
CadaclysmNode.mesh_lod
Its triangles at a coarser level of detail: 0 is CadaclysmNode.mesh itself, 1 up to Cadaclysm.lod_levels each about a quarter of the triangles of the one before, and past that empty. Every level shares the level-0 vertices — the same positions, only the indices differ — so upload the vertices once and switch level by drawing a different index range. Simplifying costs about what meshing did, once per node.
The C API and the other wrappers have it.
CadaclysmNode.lod_error
How far CadaclysmNode.mesh_lod at this level moved the surface, in the scene's units — what to pick a level by against the pixel size on screen. Zero at level 0.
The C API and the other wrappers have it.
CadaclysmNode.lightmap_uvs
var lightmap_uvs: PackedVector2Array # read-only
A second set of texture coordinates for CadaclysmNode.mesh, one (u, v) per vertex in the same order, packed into the unit square with no two triangles overlapping — what a baked lightmap needs, where the material coordinates repeat. Asked for when the scene is opened, with a lightmap resolution in texels: each face is one chart, two texels apart and one texel in from the edges at that size. an empty PackedVector2Array when it was not asked for, for a mesh with no B-rep behind it, and for a body whose charts did not fit at that resolution — the scene's diagnostics say which; open it again larger.
CadaclysmNode.surfaces
var surfaces: Array[Dictionary] # read-only
Its faces as exact surfaces plus the trim loops that cut them, each in the surface's own (u, v). Nothing is meshed to produce it, and reading it costs CadaclysmNode.mesh nothing. Empty where the reader has no parametric description (a tessellated body, a mesh format). In the file's frame — see CadaclysmScene.surface_matrix.
CadaclysmNode.edges
var edges: CadaclysmPolylines # read-only
Its feature edges as polylines, for an outline overlay. Builds the geometry if needed.
CadaclysmNode.brep
var brep: CadaclysmBrep # read-only
Its exact B-rep, as a CadaclysmBrep, for the kernel's CadaclysmSolid.from_node() to operate on — or null where it has none (a mesh, a curve, a CSG body, an OpenSCAD part read without the kernel). Shared with the scene, not copied.
CadaclysmNode.curves
var curves: CadaclysmPolylines # read-only
Its free curves as polylines; a 2D drawing is all of these.
CadaclysmNode.isocurves
var isocurves: CadaclysmPolylines # read-only
Lines ruled across its surfaces, so a curved face reads as curved in a wireframe. A flat face yields its outline, so these can overlap CadaclysmNode.edges.
CadaclysmNode.edge_beziers
Its feature edges as cubic Bézier curves, a Beziers — exact where the file's curves were, where CadaclysmNode.edges are their chords. Builds the geometry if needed.
The C API and the other wrappers have it.
CadaclysmNode.edge_beziers64
CadaclysmNode.edge_beziers in double precision, kept beside the float Béziers: a forget leaves it valid, unlike CadaclysmNode.mesh64 — in a wrapper that lends views. Node and Godot copy both, so a forget leaves both valid.
Godot's geometry is single precision; the Rust SDK it is built on has it.
CadaclysmNode.curve_beziers
Its free curves as cubic Béziers; see CadaclysmNode.edge_beziers.
The C API and the other wrappers have it.
CadaclysmNode.curve_beziers64
CadaclysmNode.curve_beziers in double precision; see CadaclysmNode.edge_beziers64.
Godot's geometry is single precision; the Rust SDK it is built on has it.
CadaclysmNode.isocurve_beziers
Its isocurves as cubic Béziers; see CadaclysmNode.edge_beziers.
The C API and the other wrappers have it.
CadaclysmNode.isocurve_beziers64
CadaclysmNode.isocurve_beziers in double precision; see CadaclysmNode.edge_beziers64.
Godot's geometry is single precision; the Rust SDK it is built on has it.
CadaclysmNode.silhouette_beziers
Where this node's surfaces turn away from the eye, which no edge of it lies on, as rational cubic Béziers in double precision, from the camera the options describe: CadaclysmNode.svg()'s own words, so the words that draw a picture ask about the same eye. tolerance is read as a fraction of the page's width, and nothing else in the options changes the curves; the line-set flags are not read.
A copy, unlike CadaclysmNode.edge_beziers64. The library keeps one silhouette slot per scene, and the next silhouette call on that scene — for any node — overwrites it, so a view into it would change under a caller who asked twice. The curves are copied out of the slot before the call returns: asking for several nodes' silhouettes in a loop keeps every answer, and a CadaclysmScene.close() leaves them valid. Calls sharing one scene across threads must be serialised by the caller, as the library documents.
A node with no silhouette — no exact B-rep, or every face planar, a cuboid's — is an empty answer (count 0), not an error. The library clears its error slot as the call starts, so an empty answer leaves no message and a refusal leaves one; that is how the two are told apart, and why a failure from an earlier call cannot be mistaken for this call's empty answer. returns null, false or an empty value (the reason in Cadaclysm.last_error()) on a refusal: a refused option, a body with no measurable geometry, or a node that holds no shape of its own (a container above the parts).
The C API and the other wrappers have it.
CadaclysmNode.collision
The collision body for what this node draws, as a Collision: a box, sphere, capsule or cylinder where one fits, else a convex hull. hull_budget is the most triangles a hull may have; 0 (the default) asks for the Unity limit of 255 and is not clamped to it. null for a node that draws nothing. Builds the mesh if it is not built; cached per node and budget.
The C API and the other wrappers have it.
CadaclysmNode.collision_hull
The convex hull CadaclysmNode.collision counted, as triangles — a CollisionHull, a view into the scene (a copy in Node and Godot). Empty for a node that draws nothing. Asking the same node for a different hull_budget refits it and frees the hull the earlier call returned: hold one budget.
The C API and the other wrappers have it.
The surface path
CadaclysmNode.is_meshed
Whether its mesh has been built and is held — by CadaclysmScene.realize_all(), by an ask for it, or by anything else that needed it. A renderer drawing the part from its surfaces checks it never paid for the triangles.
The C API and the other wrappers have it.
CadaclysmNode.triangle_estimate
About how many triangles CadaclysmNode.mesh would give, without building it — for sizing a budget before meshing. Exact for a stored mesh, within a few tens of percent for a B-rep; -1 where the reader cannot say without doing the work, and for a node that draws nothing. Treat -1 as unknown, never as zero.
The C API and the other wrappers have it.
CadaclysmNode.bounds_placed
The box of what this node draws under a placement (16 numbers, column-major, as CadaclysmPlacement.raw_transform; null for the identity), for a part drawn from its surfaces: every sample is carried through the convention and the placement before it is boxed, so it is tighter than placing the corners of CadaclysmNode.bounds. All zeros for a part with no surfaces.
The C API and the other wrappers have it.
CadaclysmNode.bounds_placed64
CadaclysmNode.bounds_placed in double precision, from the unnarrowed surface samples; see CadaclysmNode.bounds64.
Godot's geometry is single precision; the Rust SDK it is built on has it.
CadaclysmNode.surface_edges
Its face boundaries taken from its trimmed surfaces — the outline that costs no tessellation, where CadaclysmNode.edges meshes the part. In the surfaces' own frame (CadaclysmScene.surface_matrix); empty without surfaces. A shared edge appears once from each face.
The C API and the other wrappers have it.
CadaclysmNode.surface_edge_beziers
Its edges as the exact curves, a Beziers, where the part has them without meshing — a Rhino extrusion's rims are its profile — and empty everywhere else. A caller drawing from surfaces tries it before CadaclysmNode.surface_edges, whose trims are thinned to the mesh tolerance and so cut chords across a curve the surface rounds. The same segments as CadaclysmNode.edge_beziers, in the scene's space: not the surfaces' frame, so no CadaclysmScene.surface_matrix.
The C API and the other wrappers have it.
CadaclysmNode.edge_colours
var edge_colours: Array[Variant] # read-only
One RGBA per polyline of CadaclysmNode.edges, and none for an edge the file does not style; empty when nothing is styled. STEP files carry them as CURVE_STYLE styling.
CadaclysmNode.surface_edge_colours
CadaclysmNode.edge_colours for CadaclysmNode.surface_edges.
Godot has no surface_edges; the C API and the other wrappers have it.
CadaclysmNode.surface_isocurves
Its isocurves taken from its trimmed surfaces and clipped to the trims, without meshing: lines at a surface's bend lines and an even spread where it has none; a flat face gets none. In the surfaces' frame; empty without surfaces.
The C API and the other wrappers have it.
CadaclysmNode.surface_pick
Where a segment first meets this part's surfaces, or null. Exact — it answers from the surface and tests the trims at the hit's own (u, v) — and in the surfaces' own frame: carry a ray from the scene's space through the inverse of CadaclysmScene.surface_matrix first.
The C API and the other wrappers have it.
CadaclysmNode.surface_proxy_mesh
A coarse mesh over its surfaces for the things that need triangles and not a picture — ray tracing, distance fields: each face gridded cells by cells over its trim window, two triangles a cell whose centre lies inside the trims, never welded. Built once per part at the first cells asked for. In the scene's space, like CadaclysmNode.mesh. Empty without surfaces or for zero cells.
The C API and the other wrappers have it.
CadaclysmNode.save_mesh()
func save_mesh(path: String, format: String) -> bool
Write this node's own mesh — where it is defined, without its placement — in one of Cadaclysm.mesh_formats(). A node that draws nothing, or an unknown format, returns null, false or an empty value (the reason in Cadaclysm.last_error()); ask CadaclysmNode.can_mesh first to grey out a menu entry. To write the whole model, see CadaclysmScene.save().
CadaclysmNode.walk()
func walk() -> Array[CadaclysmNode]
This node and every node under it, parents before children.
CadaclysmNode.show
Draw what this node and everything under it places with the viewer in use — shown by handle on its scene, hiding the siblings along the path from the scene's root to this node (each ancestor's own geometry stays visible) and framing this node. Keywords as CadaclysmScene.show. With the GPU library (import cadaclysm.view.wgpu) the drawing replaces what one shared window shows and stays live — at the REPL, in IPython and in Jupyter by themselves, in a script until it exits; cadaclysm.view.View draws several items or several windows.
Comes with the viewers follow-up.
CadaclysmNode.view
Orbit this node and everything under it; returns the camera where it was left — a dict of eye, target, up, orthographic, azimuth and elevation — and pick, what was last clicked (item, node, face) or None. A fresh window, run until closed, with the GPU library.
Comes with the viewers follow-up.
CadaclysmNode.svg()
func svg(path: String) -> bool
This node's own wireframe as SVG, in its own frame — CadaclysmScene.svg()'s keywords, read from just this node rather than every placement. With path, writes the file and returns null; without, returns the SVG text. returns null, false or an empty value (the reason in Cadaclysm.last_error()) on a refused option (naming the field) or a failed write.
array_mesh and edge_mesh Godot only
func array_mesh() -> ArrayMesh
func edge_mesh(colour: Color = Color(0.07, 0.07, 0.08)) -> ArrayMesh
The node's triangles as an ArrayMesh, in its own frame, wound for Godot and painted its own colour (or grey); and its edges and free curves as a lines ArrayMesh, unshaded in colour. null where there is nothing to draw. Place either with CadaclysmPlacement.transform.
svg_text and svg_with Godot only
func svg_text() -> String
func svg_text_with(options: Dictionary) -> String
func svg_with(path: String, options: Dictionary) -> bool
CadaclysmNode.svg() split as CadaclysmScene's svg_text/svg_with are: svg_text()/svg(path) with every default, svg_text_with(options)/svg_with(path, options) with the keywords as a Dictionary.
CadaclysmBrep
class CadaclysmBrep extends RefCounted
A body's exact B-rep — the trimmed surfaces its mesh is cut from — shared with the scene rather than copied, and held by this object until it is released. It is what CadaclysmNode.brep hands the kernel's CadaclysmSolid.from_node(), which operates on it without a copy, and it can say whether it is a Manifold. It outlives the scene it came from for as long as anything holds it. In the node's own frame and the file's own units and axes; the kernel library must come from the same release as the reader.
CadaclysmBrep.pointer()
func pointer() -> int
The brep's C pointer, which the kernel's wrapper hands across. returns null, false or an empty value (the reason in Cadaclysm.last_error()) once released.
CadaclysmBrep.layout_id()
static func layout_id() -> String
How this library lays a brep out in memory: its compiler, target and source. The kernel shares a brep only with a reader whose id equals its own.
CadaclysmBrep.manifold()
func manifold() -> Dictionary
Whether its faces make a manifold — every edge bordered by one face or two, the faces round every vertex one fan — and whether it is closed, as a Manifold. Read off the topology the file wrote, not a mesh. returns null, false or an empty value (the reason in Cadaclysm.last_error()) once released.
CadaclysmBrep.sew
This brep with its free edges sewn, and what was sewn, as a new CadaclysmBrep and a SewReport; this one is left as it was. Two free edges become one shared edge where both their ends coincide within vertex — by default the rounding CadaclysmBrep.manifold() merges vertices at — and their curves lie within tolerance of each other, by default vertex too, so only edges that are one curve written twice are joined. A larger tolerance also joins two curves between the same two vertices that part by up to it; vertex is what decides which edges are candidates at all, and raising it is what could close a slot. Nothing moves. returns null, false or an empty value (the reason in Cadaclysm.last_error()) once released.
The C API and the other wrappers have it.
CadaclysmBrep.health()
func health(tolerance: float = 0.0, mesh: bool = false) -> Dictionary
What is wrong with this brep, as a HealthReport: the free edges and the wires they chain into, each with its nearest partner and the gap to it; the features below tolerance; the loose edges; and what sewing would join and leave. Nothing moves. tolerance is an absolute length, as Rhino's model tolerance is, by default 1e-4 times the diagonal; a NaN, infinite, zero or negative one takes the default, and the report shows what was used. A partner is the nearest free edge other than a neighbour on the wire, so a rim reads as a gap the size of the part; shared_ends 2 is what CadaclysmBrep.sew joins. mesh=True also meshes the brep and reports where the mesh cracks; an open body's crack census is empty by design (not asked), and cracks are only counted on a closed body. Loose edges are compared against the larger of the tolerance recorded and the one given. returns null, false or an empty value (the reason in Cadaclysm.last_error()) once released.
Returns the report as a Dictionary (see HealthReport); an empty one on failure. tolerance defaults to 0, which, as any value not finite and positive, takes the library's default.
CadaclysmBrep.heal()
func heal(tolerance: float = 0.0, edges: bool = true, faces: bool = true, holes: bool = true) -> Dictionary
This brep with its small features removed, beside a HealReport of what was done and left, as a new CadaclysmBrep; this one is left as it was. It heals what CadaclysmBrep.health() lists as small at the same tolerance, so health first tells what it will do.
Each kind's fix: a short edge's two ends are merged into one vertex and the edge dropped; a collapsed edge (a trim collapsed to a point where its surface is not singular) is dropped; a sliver face's short ends are merged, then the face is dropped and its two long sides sewn into one edge; a tiny face's corners are merged into one vertex and the face is dropped with its edges; a small hole (an inner loop whose edges are all free: a pinhole in an open sheet) is dropped from its face. A hole with walls (a bore) is not a small hole, and a tiny body is listed but never removed.
Everything is a vertex merge no wider than tolerance: a cluster of vertices that spans more, measured by every trim end at them, is refused (chain), so a run of short edges cannot swallow a long one, nor a loosely written corner move an end further. No edit moves a trim further than tolerance: a trim end on a surface pole keeps its uv, an end sent further is left, and a curve edit that would move further is discarded and only the vertex moves. A stack of slivers whose outer faces part by more than tolerance is not sewn across (neighbours_part). Each edge that moved records how far as its CadaclysmBrep.edge_tolerance(), as sewing records a gap; an end that could not move records how far it was left from the merged vertex.
A guard compares the result's health with this brep's. If it is worse — less closed, more free or non-manifold edges, or no faces left — healing retries with the face pass off; if that is still worse, this brep comes back as it was. guarded is set whenever the guard refused a fix. So a lone sliver sheet comes back as a face of two trims: its short ends merged, the sliver refused.
edges, faces and holes switch each kind of fix; a kind switched off is refused as toggled. tolerance null, NaN, infinite, zero or negative takes the default, 1e-4 times the diagonal; the report shows what was used. In the browser the reader module's Scene.healed returns the report only: heal the body through the blacksmith module's Solid.heal. returns null, false or an empty value (the reason in Cadaclysm.last_error()) once released.
Returns a Dictionary {body, report}, report the HealReport Dictionary; an empty one on failure. The three kinds are the edges, faces and holes arguments; tolerance as health's.
CadaclysmBrep.edge_tolerance()
func edge_tolerance(edge: int) -> float
How far edge edge (a brep edge id, as a HealFix or FreeEdge names one) may lie off its curve: 0 for an exact edge, the distance healing or sewing moved it where that is recorded, null when no trim names the id (an edge healing removed). returns null, false or an empty value (the reason in Cadaclysm.last_error()) once released.
NAN for none: Godot has no null number. An id outside 0 to 4294967295 is refused (NAN, with the reason in Cadaclysm.last_error()).
CadaclysmBrep.recognize()
func recognize(tolerance: float = 0.0) -> Dictionary
This brep with its free-form surfaces and edge curves given their analytic kind, beside a RecognizeReport of what was taken and left, as a new CadaclysmBrep; this one is left as it was. A NURBS, revolved, extruded or swept surface that is a plane, cylinder, cone, sphere or torus within tolerance of every sample of its faces and every point of their edges becomes exactly that; an edge curve that is a line, circle or ellipse within it likewise, over the same stretch run the same way. So a file that stored its analytic faces as NURBS — a .3dm above all, and many STEP and SAT exports — comes back as it was made, and verbs that read a face's kind (a hole's axis, a fillet's radius) work on it.
Faces and edges keep their numbers, so a face or edge picked before is the same one after. The faces of one surface are taken together or not at all. A face given only by trims in its old surface's parameters (.3dm, IGES) is lifted to space edges first. Volume and area move by no more than the tolerance allows.
tolerance null, NaN, infinite, zero or negative takes the default, 1e-6 of the body's extent; the report shows what was used. Not the file's declared tolerance: at a STEP file's usual 0.01, a fillet's blend reads as a torus and the body's area moves by parts in a thousand. In the browser the reader module's Scene.recognized returns the report only: recognise the body through the blacksmith module's Solid.recognize. returns null, false or an empty value (the reason in Cadaclysm.last_error()) once released.
Returns a Dictionary {body, report}, report the RecognizeReport Dictionary; an empty one on failure. tolerance defaults to 0, which, as any value not finite and positive, takes the library's default.
CadaclysmBrep.release()
func release() -> void
Give the reference back now. Leaving a with block, or the garbage collector, does it otherwise.
CadaclysmPlacement
class CadaclysmPlacement extends RefCounted
One drawing of one node's geometry at one place: what CadaclysmScene.placements lists. Two drawings of the same shape name the same geometry node, and so the same arrays — upload once, draw twice.
CadaclysmPlacement.geometry
var geometry: CadaclysmNode # read-only
The node whose mesh, edges and curves this draws.
CadaclysmPlacement.select
var select: CadaclysmNode # read-only
What a click on this drawing selects: the placement's own node rather than the shared shape, which would light up every copy.
CadaclysmPlacement.transform
var transform: Transform3D # read-only
Where to draw it: a 4×4, already composed through every frame from the root.
CadaclysmPlacement.raw_transform
var raw_transform: PackedFloat64Array # read-only
The same matrix as 16 numbers, column-major.
CadaclysmLink
class CadaclysmLink extends RefCounted
A rigid body of the file's mechanism: the nodes that move together when a joint moves it. A STEP file's kinematic links; other formats record none.
CadaclysmLink.scene
The scene this link belongs to.
Not exposed: keep the CadaclysmScene you opened.
CadaclysmLink.nodes
var nodes: Array[CadaclysmNode] # read-only
The topmost node of each subtree it moves, in node order: moving these moves everything under them.
CadaclysmJoint
class CadaclysmJoint extends RefCounted
A connection between two links. Its two ends keep the file's order, not a parent and a child, since a mechanism may be a network with loops.
CadaclysmJoint.scene
The scene this joint belongs to.
Not exposed: keep the CadaclysmScene you opened.
CadaclysmJoint.pair
var pair: CadaclysmPair # read-only
How this joint moves: the kinematic pair naming it, a CadaclysmPair, or null when the file gives it none.
CadaclysmPair
class CadaclysmPair extends RefCounted
A kinematic pair: the kind of relative motion a joint allows between its two links — what CadaclysmJoint.pair returns.
CadaclysmPair.kind
var kind: String # read-only
One of thirteen kinds: revolute, prismatic, cylindrical, spherical, spherical_with_pin, planar, universal, homokinetic, screw, fully_constrained, unconstrained, low_order, other.
CadaclysmPair.type_name
var type_name: String # read-only
For other: the pair's entity type name (GEAR_PAIR). null otherwise.
"" otherwise — Godot has no null string.
CadaclysmPair.pitch
var pitch: float # read-only
For screw: its pitch, a length per revolution in the scene's units. null otherwise.
NAN otherwise — Godot has no null number.
CadaclysmPair.kind_name
var kind_name: String # read-only
The kind by name, finer than kind: the same thirteen names, and gear and rack_and_pinion for the two coupled pairs kind reads as other.
CadaclysmPair.parameters
var parameters: PackedFloat64Array # read-only
The pair's own numbers, in the order CadaclysmAssembly.pair_with() takes them: screw its pitch, rack_and_pinion its pinion radius, gear its first radius, second radius, ratio (the second link's rotation over the first's, signed), bevel and helical angle — always five. Empty for every other kind.
CadaclysmPair.frame_start
var frame_start: Transform3D # read-only
The pair's contact frame fixed in its joint's start link, in world coordinates at the file's rest pose: a 4x4, already composed like CadaclysmNode.transform.
CadaclysmPair.frame_end
var frame_end: Transform3D # read-only
The pair's contact frame fixed in its joint's end link.
CadaclysmPair.raw_frame_start
var raw_frame_start: PackedFloat64Array # read-only
frame_start as 16 numbers, column-major — like CadaclysmNode.raw_transform.
CadaclysmPair.raw_frame_end
var raw_frame_end: PackedFloat64Array # read-only
frame_end as 16 numbers, column-major.
CadaclysmPair.freedoms
var freedoms: Array[CadaclysmFreedom] # read-only
Its degrees of freedom, in the reader's per-kind order, each a CadaclysmFreedom. A CadaclysmState's values compose in this order.
CadaclysmFreedom
class CadaclysmFreedom extends RefCounted
One degree of freedom of a CadaclysmPair: which motion, about or along which contact-frame axis, and its optional range. From CadaclysmPair.freedoms.
CadaclysmFreedom.axis
var axis: String # read-only
x, y or z: the contact frames' axis the motion is about or along.
CadaclysmFreedom.lower
var lower: float # read-only
The lower limit — radians for a rotation, a length for a translation — or null for unbounded.
NAN for unbounded — Godot has no null number.
CadaclysmFreedom.upper
var upper: float # read-only
The upper limit, or null for unbounded.
NAN for unbounded — Godot has no null number.
CadaclysmState
class CadaclysmState extends RefCounted
A named pose of the file's mechanism: a MECHANISM_STATE_REPRESENTATION. From CadaclysmScene.states.
CadaclysmState.values
var values: Array[CadaclysmStateValue] # read-only
One row per joint this state sets, in file order: the joint, then one value per freedom of its pair, in the pair's freedom order.
CadaclysmStateValue Godot only
class CadaclysmStateValue extends RefCounted
var joint: CadaclysmJoint # read-only
var values: PackedFloat64Array # read-only
static func create(joint: CadaclysmJoint, values: PackedFloat64Array) -> CadaclysmStateValue
CadaclysmState.values's row type, since GDScript has no tuple: joint (the joint this row sets) and values (one number per freedom of the joint's pair, in the pair's freedom order). CadaclysmStateValue.create(joint, values) builds one row, for CadaclysmScene.pose()'s values Array.
CadaclysmSequence
class CadaclysmSequence extends RefCounted
A motion the file records: an INTERPOLATED_CONFIGURATION_SEQUENCE, its states at increasing parameter values. From CadaclysmScene.sequences.
CadaclysmSequence.name
var name: String # read-only
Its name: its representation's, name #2 and on for further sequences in one representation.
CadaclysmSequence.closed
var closed: bool # read-only
Whether the motion returns to its first segment (its last segment is not discontinuous).
CadaclysmSequence.seconds_per_unit
var seconds_per_unit: float # read-only
Seconds per unit of the parameter where the file states a time unit, or null where it states none (the parameter is then read as seconds).
The seconds rule, to play a sequence on a clock: with a duration, stretch start to end (plus the closing span of a closed sequence, (end - start) divided by one less than the number of segments) over it; with none, seconds are (t - start) times CadaclysmSequence.seconds_per_unit, or times 1 where it is null.
NAN where the file states none — Godot has no null number.
CadaclysmSequence.segments
var segments: Array[CadaclysmSegment] # read-only
The segments, in file order (at least two), each a CadaclysmSegment.
CadaclysmSequence.end
var end: float # read-only
The last segment's parameter (the closing span of a closed sequence not included).
CadaclysmSequence.pose()
func pose(t: float, ground: CadaclysmLink) -> CadaclysmPose
The mechanism posed by this sequence at parameter t, in the file's own parameter: a segment is a keyframe of its state, a discontinuous segment holds until the next and every other kind moves linearly, an open sequence holds its ends and a closed one wraps (its closing span, last back to first, is the mean of its spans, and each joint loops on its own keys, so one that only some segments name still comes back round smoothly). ground is held fixed as CadaclysmScene.pose() does. returns null, false or an empty value (the reason in Cadaclysm.last_error()) for a t that is not finite.
CadaclysmSequence Godot only
class CadaclysmSequence extends RefCounted
var index: int # read-only
var name: String # read-only
var closed: bool # read-only
var seconds_per_unit: float # read-only
var segments: Array[CadaclysmSegment] # read-only
var start: float # read-only
var end: float # read-only
func pose(t: float, ground: CadaclysmLink) -> CadaclysmPose
CadaclysmScene.sequences' element type: index, name, closed, seconds_per_unit (NAN where the file states no time unit), segments, start, end and pose(t, ground), which poses the mechanism at parameter t (ground a CadaclysmLink or null) and answers null, the reason in Cadaclysm.last_error(), for a t that is not finite.
CadaclysmSegment
class CadaclysmSegment extends RefCounted
One step of a CadaclysmSequence: the state it reaches, its parameter, and how the motion leaves it for the next. From CadaclysmSequence.segments.
CadaclysmSegment.state
var state: CadaclysmState # read-only
The CadaclysmState this segment reaches.
CadaclysmSegment.interpolation
var interpolation: String # read-only
How the motion leaves it: "undefined", "discontinuous", "synchronous" or "linear".
CadaclysmSegment Godot only
class CadaclysmSegment extends RefCounted
var state: CadaclysmState # read-only
var t: float # read-only
var interpolation: String # read-only
CadaclysmSequence.segments' element type: state (a CadaclysmState), t and interpolation ("undefined", "discontinuous", "synchronous" or "linear").
CadaclysmWorkSchedule
class CadaclysmWorkSchedule extends RefCounted
A building's programme: an IfcWorkSchedule and the tasks it controls. From CadaclysmScene.schedules. Dates are seconds since 1970-01-01T00:00 (no time zone); durations and lags are seconds.
CadaclysmWorkSchedule.name
var name: String # read-only
Its name, else its identification, else schedule #k (k from 1, in file order).
CadaclysmWorkSchedule.identification
var identification: String # read-only
Its identification, empty where the file gives none.
CadaclysmWorkSchedule.kind
var kind: String # read-only
"planned", "actual", "baseline", "notdefined" or "other".
CadaclysmWorkSchedule.kind_name
var kind_name: String # read-only
The text of a user-defined kind (kind is "other"); empty otherwise.
CadaclysmWorkSchedule.start
var start: float # read-only
The schedule's start date, or null where the file gives none.
CadaclysmWorkSchedule.finish
var finish: float # read-only
The schedule's finish date, or null where the file gives none.
CadaclysmWorkSchedule.tasks
var tasks: Array[CadaclysmTask] # read-only
Its tasks, in file order, each a CadaclysmTask.
CadaclysmWorkSchedule.links
var links: Array[CadaclysmTaskLink] # read-only
Its task links (IfcRelSequence), in file order, each a CadaclysmTaskLink.
CadaclysmWorkSchedule.at()
func at(date: float, dates: String = "scheduled") -> Variant
What each element this schedule names is doing on date, as CadaclysmElementState rows in node order; an element no task names is not listed. dates says which of a task's dates to play: "scheduled" (the default) or "actual", where each actual date overrides its scheduled one. A task builds its nodes over its window, or removes them (demolition, dismantling, removal, disposal); summary tasks span their children. A task that works on a CadaclysmWorkCalendar builds over working time only, pausing at nights and weekends. returns null, false or an empty value (the reason in Cadaclysm.last_error()) for a date that is not finite, and a dates other than those two words is refused. Each call expands the calendars again: call it when the date changes, not per frame.
CadaclysmWorkSchedule Godot only
class CadaclysmWorkSchedule extends RefCounted
var index: int # read-only
var name: String # read-only
var identification: String # read-only
var kind: String # read-only
var kind_name: String # read-only
var start: float # read-only
var finish: float # read-only
var tasks: Array[CadaclysmTask] # read-only
var links: Array[CadaclysmTaskLink] # read-only
func at(date: float, dates: String = "scheduled") -> Variant
CadaclysmScene.schedules' element type. start and finish are NAN where the file gives none (dates are seconds since 1970-01-01T00:00). at(date, dates = "scheduled") answers an Array of CadaclysmElementState for the given date, dates being "scheduled" or "actual"; it answers null, the reason in Cadaclysm.last_error(), for a date that is not finite or any other dates.
CadaclysmTask
class CadaclysmTask extends RefCounted
One task of a CadaclysmWorkSchedule. From CadaclysmWorkSchedule.tasks.
CadaclysmTask.schedule
The CadaclysmWorkSchedule it belongs to.
Not exposed: use schedule_index with the scene's schedules (CadaclysmWorkSchedule).
CadaclysmTask.schedule_index
var schedule_index: int # read-only
The index of the work schedule this task belongs to (scene.schedules[i]).
CadaclysmTask.identification
var identification: String # read-only
Its identification, empty where the file gives none.
CadaclysmTask.kind
var kind: String # read-only
"attendance", "construction", "demolition", "dismantle", "disposal", "installation", "logistic", "maintenance", "move", "operation", "removal", "renovation", "notdefined" or "other".
CadaclysmTask.kind_name
var kind_name: String # read-only
The text of a user-defined kind (kind is "other"); empty otherwise.
CadaclysmTask.status
var status: String # read-only
Its status as the file writes it, empty where none.
CadaclysmTask.milestone
var milestone: bool # read-only
Whether it is a milestone: an instant, not a span.
CadaclysmTask.parent
var parent: CadaclysmTask # read-only
The summary task nesting it, or null for a top-level task.
CadaclysmTask.nodes
var nodes: Array[CadaclysmNode] # read-only
The nodes it builds or removes, each a CadaclysmNode.
CadaclysmTask.calendar_index
var calendar_index: Variant # read-only
The index of the work calendar this task works on (scene.calendars[i]), or null where it has none.
CadaclysmTask.calendar
var calendar: CadaclysmWorkCalendar # read-only
The CadaclysmWorkCalendar this task works on, or null where it has none.
CadaclysmTask Godot only
class CadaclysmTask extends RefCounted
var index: int # read-only
var schedule_index: int # read-only
var name: String # read-only
var identification: String # read-only
var kind: String # read-only
var kind_name: String # read-only
var status: String # read-only
var milestone: bool # read-only
var parent: CadaclysmTask # read-only
var time: CadaclysmTaskTime # read-only
var nodes: Array[CadaclysmNode] # read-only
CadaclysmWorkSchedule.tasks' element type: parent is null for a top-level task, time a CadaclysmTaskTime and nodes an Array of CadaclysmNode.
CadaclysmTaskTime
class CadaclysmTaskTime extends RefCounted
Every date pair a task gives, in seconds since 1970-01-01T00:00; each is null where the file gives none. From CadaclysmTask.time.
CadaclysmTaskTime.duration
var duration: float # read-only
The scheduled duration, in elapsed seconds.
CadaclysmTaskTime.duration_kind
var duration_kind: Variant # read-only
How the file means the duration: "ELAPSEDTIME", "WORKTIME" or "NOTDEFINED"; null where the file gives none. A task with a CadaclysmTask.calendar counts working time unless this is "ELAPSEDTIME"; a task with no calendar always counts elapsed time.
CadaclysmTaskTime.work_duration
var work_duration: Variant # read-only
The duration as working time: that many working days, then that many seconds of working time, as a (days, seconds) pair. null for an IFC2X3 task or one with no duration. A year is read as 260 working days, a month as 20, a week as 5 and a day as 1; hours, minutes and seconds are working seconds. So P2DT4H is 2 days and 14400 seconds.
A Dictionary of days and seconds, null where there is none.
CadaclysmTaskTime Godot only
class CadaclysmTaskTime extends RefCounted
var schedule_start: float # read-only
var schedule_finish: float # read-only
var early_start: float # read-only
var early_finish: float # read-only
var late_start: float # read-only
var late_finish: float # read-only
var actual_start: float # read-only
var actual_finish: float # read-only
var duration: float # read-only
CadaclysmTask.time's type: every date pair a task gives, NAN where the file gives none (seconds since 1970-01-01T00:00; duration in seconds).
CadaclysmWorkCalendar
class CadaclysmWorkCalendar extends RefCounted
When work happens: an IfcWorkCalendar. From CadaclysmScene.calendars or CadaclysmTask.calendar. A calendar's working time is the union of its working times' occurrences minus the union of its exceptions' (exceptions only ever remove time). A calendar with no working times works every day, all day, less its exceptions. Dates are seconds since 1970-01-01T00:00 (no time zone). The queries refuse, with these messages, a from or to that is not finite (from and to must be finite), a from after to (from must not be after to), a CadaclysmWorkCalendar.working_periods() or CadaclysmWorkCalendar.working_seconds() range longer than 100 years (from and to must lie within 100 years of each other) and a calendar with no working time within 100 years of the date searched (no working time within 100 years).
CadaclysmWorkCalendar.name
var name: String # read-only
Its name, else its identification, else calendar #k (k from 1, in file order).
CadaclysmWorkCalendar.identification
var identification: String # read-only
Its identification, empty where the file gives none.
CadaclysmWorkCalendar.kind
var kind: String # read-only
"FIRSTSHIFT", "SECONDSHIFT", "THIRDSHIFT", "NOTDEFINED" or "USERDEFINED".
CadaclysmWorkCalendar.kind_name
var kind_name: String # read-only
The text of a user-defined kind (kind is "USERDEFINED"); empty otherwise.
CadaclysmWorkCalendar.working
var working: Array[CadaclysmWorkTime] # read-only
Its working times, in file order, each a CadaclysmWorkTime.
CadaclysmWorkCalendar.exceptions
var exceptions: Array[CadaclysmWorkTime] # read-only
Its exception (non-working) times, in file order, each a CadaclysmWorkTime.
CadaclysmWorkCalendar.working_periods()
func working_periods(from: float, to: float) -> Variant
The working periods overlapping from..to, clipped to it, sorted and merged so no two touch or overlap: (start, end) pairs of dates, in seconds. returns null, false or an empty value (the reason in Cadaclysm.last_error()) for a from or to that is not finite, a from after to, or a range longer than 100 years. Playback uses this to pause a task across nights and weekends; the web build's workingPeriods returns the same pairs as one flat Float64Array.
CadaclysmWorkCalendar.working_seconds()
func working_seconds(from: float, to: float) -> Variant
The working seconds in from..to. returns null, false or an empty value (the reason in Cadaclysm.last_error()) as CadaclysmWorkCalendar.working_periods() does.
CadaclysmWorkCalendar.add_work()
func add_work(from: float, days: float, seconds: float = 0.0) -> Variant
The date days working days, then seconds of working time, after from (before it, when negative). A forward result that lands at the start of a working day is reported as the end of the previous one, so a ten-day task starting Monday 08:00 on a weekday 08:00-17:00 calendar finishes on the second Friday at 17:00. returns null, false or an empty value (the reason in Cadaclysm.last_error()) for a non-finite argument, and for a calendar with no working day within 100 years.
CadaclysmWorkTime
class CadaclysmWorkTime extends RefCounted
A repeating set of working periods, or among a calendar's exceptions of non-working ones, valid between two dates: an IfcWorkTime. From CadaclysmWorkCalendar.working or CadaclysmWorkCalendar.exceptions.
CadaclysmWorkTime.start
var start: float # read-only
The first day it applies, as that day's midnight (seconds since 1970-01-01T00:00), or null for an open start.
CadaclysmWorkTime.finish
var finish: float # read-only
The last day it applies, as that day's midnight (the day itself is included), or null for an open end.
CadaclysmWorkTime.pattern
var pattern: CadaclysmRecurrence # read-only
Its CadaclysmRecurrence, or null for every day of the range, all day.
CadaclysmRecurrence
class CadaclysmRecurrence extends RefCounted
Which days a CadaclysmWorkTime occurs on and when within each: an IfcRecurrencePattern. From CadaclysmWorkTime.pattern.
CadaclysmRecurrence.kind
var kind: String # read-only
The IFC word: "DAILY", "WEEKLY", "MONTHLY_BY_DAY_OF_MONTH", "MONTHLY_BY_POSITION", "BY_DAY_COUNT", "BY_WEEKDAY_COUNT", "YEARLY_BY_DAY_OF_MONTH" or "YEARLY_BY_POSITION".
CadaclysmRecurrence.weekdays
var weekdays: Array # read-only
The weekdays, 1 (Monday) to 7 (Sunday), sorted.
CadaclysmRecurrence.position
var position: Variant # read-only
The position among the month's listed weekdays: 1 to 5 from the month's start, -1 from its end; null where the file gives none.
CadaclysmRecurrence.interval
var interval: Variant # read-only
Every how many days, weeks, months or years; null where the file gives none (every one).
CadaclysmRecurrence.occurrences
var occurrences: Variant # read-only
How many occurring days, counted from the work time's start, before it stops; null for no limit.
CadaclysmRecurrence.periods
var periods: Array # read-only
The working periods within an occurring day, as (start, end) pairs of seconds after midnight, in file order; empty for the whole day.
CadaclysmTaskLink
class CadaclysmTaskLink extends RefCounted
A sequence between two tasks of one schedule (IfcRelSequence). From CadaclysmWorkSchedule.links.
CadaclysmTaskLink.kind
var kind: String # read-only
"finish_start", "start_start", "finish_finish", "start_finish", "notdefined" or "other".
CadaclysmTaskLink.kind_name
var kind_name: String # read-only
The text of a user-defined kind (kind is "other"); empty otherwise.
CadaclysmTaskLink.lag
var lag: float # read-only
The time lag, in seconds, or null where the file gives none.
CadaclysmTaskLink Godot only
class CadaclysmTaskLink extends RefCounted
var from: CadaclysmTask # read-only
var to: CadaclysmTask # read-only
var kind: String # read-only
var kind_name: String # read-only
var lag: float # read-only
CadaclysmWorkSchedule.links' element type: from the predecessor and to the successor (each a CadaclysmTask), kind, kind_name and lag in seconds, NAN where the file gives none.
CadaclysmElementState
class CadaclysmElementState extends RefCounted
What one element is doing on a date: CadaclysmWorkSchedule.at()'s rows.
CadaclysmElementState.phase
var phase: String # read-only
"unbuilt", "building", "built", "demolishing" or "demolished".
CadaclysmElementState.progress
var progress: float # read-only
How far through the window that governs the phase, 0 to 1: 0 unbuilt, 1 built or demolished.
CadaclysmElementState.variance
var variance: float # read-only
Seconds late (positive) or early (negative) against the schedule, or null where there is none to give.
CadaclysmElementState Godot only
class CadaclysmElementState extends RefCounted
var node: CadaclysmNode # read-only
var phase: String # read-only
var progress: float # read-only
var variance: float # read-only
CadaclysmWorkSchedule.at()' row type: node (a CadaclysmNode), phase, progress and variance, NAN where there is none to give.
CadaclysmPose
class CadaclysmPose extends RefCounted
A posed mechanism: CadaclysmScene.pose(), CadaclysmScene.pose_state() or CadaclysmSequence.pose()'s answer. The document itself is unchanged. Copied eagerly out of the C handle when it is made, so it borrows nothing and outlives a CadaclysmScene.close().
CadaclysmPose.unsolved
var unsolved: Array[CadaclysmJoint] # read-only
Joints that close a loop and were not honoured, in file order, each a CadaclysmJoint.
CadaclysmPose.out_of_range
var out_of_range: Array[Dictionary] # read-only
One entry per given value that fell outside its freedom's range: the CadaclysmJoint, the freedom's index in its pair, and the value used.
CadaclysmPose.diagnostics
var diagnostics: PackedStringArray # read-only
What the couplings — a gear, a rack and pinion, a screw closing a loop — could not solve, or found disagreeing, in file order, as text in the kernel's words: coupling 'mesh': both 'drive' and 'driven' are given and disagree by 0.1, or coupling 'mesh' cannot be solved: .... Empty when the pose is what was asked: a coupling neither of whose sides is given rests, and one side given drives the other.
CadaclysmPose.transform()
func transform(node: CadaclysmNode) -> Transform3D
A node's posed transform, in the same form CadaclysmNode.transform returns.
CadaclysmPose.raw_transform()
func raw_transform(node: CadaclysmNode) -> PackedFloat64Array
The same matrix in the ABI's own column-major order, as 16 numbers.
CadaclysmPose.show
Draw this pose's scene with the viewer in use, as CadaclysmScene.show does, but with each placement moved by its select node's pose — each node a joint turned draws at its posed transform rather than its rest one. Same keywords as CadaclysmScene.show.
Comes with the persistent views of the view-wrappers project.
CadaclysmPose.view
CadaclysmPose.show's orbiting twin; returns what CadaclysmScene.view returns — the camera where it was left, and the last pick.
Comes with the persistent views of the view-wrappers project.
CadaclysmMesh
class CadaclysmMesh extends RefCounted
A node's triangles, in the node's own frame: what CadaclysmNode.mesh returns. In every wrapper that can lend a view the arrays are read-only views into the scene's memory, not copies — a large assembly is tens of millions of triangles, and most of them go straight to a GPU — and CadaclysmMesh.copy makes arrays of your own. Node and Godot copy instead, having no borrowed-view machinery at all: their arrays are theirs already, outlive CadaclysmScene.close(), and need no copy. The same split as a CadaclysmFemMesh's arrays, and for the same reason.
CadaclysmMesh.normals
var normals: PackedVector3Array # read-only
Three floats a vertex, or null for a mesh that carries none.
Empty for a mesh that carries none.
CadaclysmMesh.uvs
var uvs: PackedVector2Array # read-only
Two floats a vertex, or null: only readers asked for world-scale UVs fill them. One unit of u or v is one world unit, so faces overlap in UV space — a tiling material, not a lightmap.
Empty unless the scene was opened with uv_world.
CadaclysmMesh.colors
var colors: PackedColorArray # read-only
Four floats (RGBA) a vertex, or null — the common case. Only a body painted in several colours, opened with colours on, carries them.
Empty unless the scene was opened with colors and the body is painted in several.
CadaclysmMesh.indices
var indices: PackedInt32Array # read-only
Three vertex indices a triangle, unsigned 32-bit.
CadaclysmMesh.copy
The same arrays in memory of your own, safe to keep after CadaclysmScene.close(). Deliberately visible: on a large model this is where the gigabytes go.
A CadaclysmMesh is a copy already: it owns its arrays and outlives the scene.
is_empty and to_array_mesh Godot only
var is_empty: bool # read-only
func to_array_mesh() -> ArrayMesh
Whether there are no triangles, and these triangles as an ArrayMesh wound for Godot (the library winds them counter-clockwise, Godot the other way); null when there are none.
CadaclysmPolylines
class CadaclysmPolylines extends RefCounted
Edges or curves already flattened to points, in the node's own frame: what CadaclysmNode.edges, CadaclysmNode.curves and CadaclysmNode.isocurves return. Views into the scene, like CadaclysmMesh — copies in Node and Godot, as there.
CadaclysmPolylines.positions
var positions: PackedVector3Array # read-only
Three floats a point, the runs end to end.
CadaclysmPolylines.counts
var counts: PackedInt32Array # read-only
How many points each run has, in order.
CadaclysmPolylines.segment_indices()
func segment_indices() -> PackedInt32Array
Index pairs into the positions, two per line segment — what GL_LINES and every pair-taking API want. Indices rather than points, so a caller can transform the points once and expand afterwards.
CadaclysmPolylines.segments()
func segments() -> PackedVector3Array
The segment endpoints themselves, two points per segment.
runs and to_array_mesh Godot only
var is_empty: bool # read-only
func runs() -> Array[PackedVector3Array]
func to_array_mesh(colour: Color = Color(0.07, 0.07, 0.08)) -> ArrayMesh
Whether there are no points; each run as its own PackedVector3Array; and the lines as a lines ArrayMesh, unshaded in colour (null when empty).
Beziers
Edges, curves or isocurves as cubic Bézier curves, exact where the file's curves were: what CadaclysmNode.edge_beziers, CadaclysmNode.curve_beziers and CadaclysmNode.isocurve_beziers return. Views into the scene, like CadaclysmPolylines — copies in Node and Godot, as there.
The C API and the other wrappers have it.
Beziers.points
Four control points a curve, three floats each.
The C API and the other wrappers have it.
Beziers.weights
A weight per control point: all ones for a polynomial curve, and the weights that make a circular arc exact for a rational one.
The C API and the other wrappers have it.
Beziers.copy
The same arrays in memory of your own, safe to keep after CadaclysmScene.close().
The C API and the other wrappers have it.
Mesh64
CadaclysmMesh in double precision, unnarrowed: what CadaclysmNode.mesh64 returns. Positions, normals and uvs keep the file's own precision; colours stay float32, as CadaclysmMesh.colors do. Views into the scene's memory, like CadaclysmMesh — copies in Node and Godot, as there.
Godot's geometry is single precision; the Rust SDK it is built on has it.
Mesh64.positions
Three doubles a vertex.
Godot's geometry is single precision; the Rust SDK it is built on has it.
Mesh64.normals
Three doubles a vertex, or null for a mesh that carries none.
Godot's geometry is single precision; the Rust SDK it is built on has it.
Mesh64.uvs
Two doubles a vertex, or null; see CadaclysmMesh.uvs.
Godot's geometry is single precision; the Rust SDK it is built on has it.
Mesh64.colors
Four floats (RGBA) a vertex, or null — always float32, as CadaclysmMesh.colors are.
Godot's geometry is single precision; the Rust SDK it is built on has it.
Mesh64.indices
Three vertex indices a triangle, unsigned 32-bit — the same triangles as CadaclysmMesh.indices.
Godot's geometry is single precision; the Rust SDK it is built on has it.
Mesh64.vertex_count
How many vertices.
Godot's geometry is single precision; the Rust SDK it is built on has it.
Mesh64.index_count
How many indices: three a triangle.
Godot's geometry is single precision; the Rust SDK it is built on has it.
Mesh64.triangle_count
How many triangles.
Godot's geometry is single precision; the Rust SDK it is built on has it.
Mesh64.copy
The same arrays in memory of your own, safe to keep after a forget or CadaclysmScene.close().
Godot's geometry is single precision; the Rust SDK it is built on has it.
Beziers64
Beziers in double precision, unnarrowed: what CadaclysmNode.edge_beziers64, CadaclysmNode.curve_beziers64 and CadaclysmNode.isocurve_beziers64 return. Views into the scene, like Beziers — copies in Node and Godot, as there.
Godot's geometry is single precision; the Rust SDK it is built on has it.
Beziers64.points
Four control points a curve, three doubles each.
Godot's geometry is single precision; the Rust SDK it is built on has it.
Beziers64.weights
A weight per control point, as doubles.
Godot's geometry is single precision; the Rust SDK it is built on has it.
Beziers64.count
How many curves.
Godot's geometry is single precision; the Rust SDK it is built on has it.
Beziers64.copy
The same arrays in memory of your own, safe to keep after CadaclysmScene.close().
Godot's geometry is single precision; the Rust SDK it is built on has it.
Bounds64
AABB in double precision, unnarrowed: what CadaclysmNode.bounds64, CadaclysmNode.bounds_placed64 and CadaclysmScene.bounds64 return.
Godot's geometry is single precision; the Rust SDK it is built on has it.
Bounds64.min
The low corner.
Godot's geometry is single precision; the Rust SDK it is built on has it.
Bounds64.max
The high corner.
Godot's geometry is single precision; the Rust SDK it is built on has it.
Bounds64.is_empty
Whether this is the all-zero box that stands for nothing.
Godot's geometry is single precision; the Rust SDK it is built on has it.
Bounds64.size
The extent along each axis.
Godot's geometry is single precision; the Rust SDK it is built on has it.
Bounds64.centre
The midpoint.
Godot's geometry is single precision; the Rust SDK it is built on has it.
Collision and CollisionHull
What CadaclysmNode.collision found: shape (0 none, 1 box, 2 sphere, 3 capsule, 4 cylinder, 5 hull, named by shape_name), confidence, the axis a capsule or cylinder runs along, frame (16 numbers, column-major) and half_extent — always the true oriented box — radius, height, the fit's error, and the hull's vertex and index counts. Plain data, copied out of the scene. CadaclysmNode.collision_hull is the hull itself: positions (three floats a vertex) and indices (three a triangle), views into the scene — copies in Node and Godot.
The C API and the other wrappers have it.
Collision.shape_name
none, box, sphere, capsule, cylinder or hull.
The C API and the other wrappers have it.
Collision.error
How far the fitted shape strays from the mesh, in the scene's units; zero for an exact fit.
The C API and the other wrappers have it.
Collision.frame
The oriented box's frame, 16 numbers column-major.
The C API and the other wrappers have it.
Collision.half_extent
Half the oriented box's size along its own three axes.
The C API and the other wrappers have it.
Collision.
shape, confidence, axis, radius, height, hull_vertex_count and hull_index_count, alongside frame, half_extent, error and shape_name.
The C API and the other wrappers have it.
CollisionHull.
The hull's positions, indices, vertex_count and index_count.
The C API and the other wrappers have it.
Meshlets
A mesh split into meshlets, optionally with coarser levels above them, for a mesh-shader or meshlet-based renderer. Built from any mesh — a CadaclysmNode.mesh or arrays of your own — and owned by you: free it, or let the language's scope do it (see Lifetimes).
The C API and the other wrappers have it.
Meshlets.build
Split positions (three floats a vertex), normals (the same, or none) and indices (three a triangle) into meshlets of at most max_triangles and max_vertices each. The limits are the consumer's own, with no default: Nanite takes 128 and 256, a mesh-shader pipeline 124 and 64, and the vertex cap is the one that bites. levels above 0 groups and simplifies each level into the next until one meshlet is left; Meshlets.level and a meshlet's children say which is which. A budget of zero, or arrays whose lengths do not agree, returns null, false or an empty value (the reason in Cadaclysm.last_error()) before the library is called.
The C API and the other wrappers have it.
Meshlets.level
0 for a leaf over the mesh itself, higher for a simplified level above it.
The C API and the other wrappers have it.
Meshlets.group
Which group of a levelled build meshlet i belongs to.
The C API and the other wrappers have it.
Meshlets.error
How far meshlet i's level moved the surface; zero at level 0.
The C API and the other wrappers have it.
Meshlets.child_count
How many finer meshlets sit below meshlet i.
The C API and the other wrappers have it.
Meshlet.
One meshlet's arrays and numbers, copied out: index, level, group, error, vertex_count, triangle_count, positions, normals (zeros where the mesh had none), indices (into the meshlet's own vertices) and children. The arrays are yours.
The C API and the other wrappers have it.
Meshlets.free
Give the meshlets back. Idempotent; the collector or scope does it otherwise.
The C API and the other wrappers have it.
CadaclysmFemMesh
class CadaclysmFemMesh extends RefCounted
One body meshed for a solver: nodes welded by bits, triangles wound outward, every node tagged with the lowest-dimension B-rep entity it lies on, and every crack reported rather than closed. What CadaclysmNode.fem_mesh() returns, and owned by you: free it, or let the language's scope do it (see Lifetimes).
A handle rather than a snapshot. In every wrapper that can lend a view, the big arrays are read-only views into the library's own memory, as CadaclysmNode.mesh's are and for the same reason — a solver mesh is megabytes, and copying it to hand it over would cost that twice. Node and Godot copy instead, having no borrowed-view machinery at all, so for those two the array is theirs and everything below about a stale view falls away. Either way the owner of the memory is this object rather than the scene: CadaclysmScene.close() neither frees a FEM mesh nor stales one, and meshing the body again does not either. Only CadaclysmFemMesh.release() does, or the language's own scope or collector reclaiming the handle.
So keep the FEM mesh itself reachable for as long as you read a view of it, and copy anything that must outlive it. What refuses a stale read is a different mechanism in each language, so all ten are named here rather than a rule with an "otherwise" in it. Swift's view type carries its owner and asks it before every element, so the read itself is refused — it traps inside the subscript getter, measured in a release build. Rust settles it before the program runs: its free takes the mesh by value, so a slice can neither be asked for after it nor held across it. Godot and Node hand back copies, so there is nothing of the library's left to go stale. Python, C#, Java and C++ check the handle in the accessor, so a view asked for after the free is refused and one already in hand is a bare array, span or buffer that reads freed memory — measured in C#, where a span taken before the free read the body's own coordinates out of the freed block. Python's numpy array does hold the mesh, which keeps it reachable (below), but nothing asks the mesh when the array is read, so one kept past an explicit free() dangles as C#'s span does. Go's and LuaJIT's arrays are fields filled when the mesh was built rather than accessors, so neither moment is refused there; their methods are, and for those two this is documented rather than enforced, as their own module headers already do for the scene.
Staying reachable is a second question, and a narrower one. In C#, Java, Go and LuaJIT the view is the platform's own array type with nowhere to hold a reference back to the handle, so a program that keeps a view and lets go of the mesh can have the collector free the handle under it with nothing ever calling CadaclysmFemMesh.release() — measured in C#, Java and Go. C++ has no collector but the same shape at scope end: the mesh's destructor frees the handle when it goes out of scope, and a Span kept past that reads freed memory. A view type that carries its owner is safe from that (Python's, Swift's), and so is a language that rules the case out — Rust borrows the mesh for the view's lifetime, Godot and Node copy. The same rule as CadaclysmSolid.mesh()'s own views.
CadaclysmFemMesh.nodes
var nodes: PackedFloat64Array # read-only
Every node's position, three doubles each, placed by CadaclysmNode.fem_mesh()'s placement and in the space CadaclysmFemMesh.from_mesh names. Every node is used by at least one triangle.
Every array here is a copy, as CadaclysmMesh's and CadaclysmPolylines' are: Godot's packed arrays have nowhere to point into the library's memory, so the paragraph above does not apply to Godot — one already in hand survives release(), the collector and the owner, with nothing of the library's left in it to go stale, which is also why there is no copy() to call. The price runs the other way, every ask copying again, so read nodes into a variable rather than calling it inside a loop. They are flat doubles, three a node, in a PackedFloat64Array rather than a PackedVector3Array: what a solver wants is the f64 the library computed, and Godot's Vector3 holds floats — the same reason CadaclysmNode.raw_transform and the kernel's raw_points sit beside their Godot-typed twins. A FemEdge's nodes and runs, and a FemVertex's point, are copies in the same way.
CadaclysmFemMesh.triangles
var triangles: PackedInt32Array # read-only
Three node indices a triangle, wound outward — a mirroring placement is wound back.
CadaclysmFemMesh.triangle_face
var triangle_face: PackedInt32Array # read-only
Which B-rep face each triangle lies on, one per triangle, into the body's CadaclysmFemMesh.face_count faces.
CadaclysmFemMesh.node_kind
var node_kind: PackedInt32Array # read-only
What each node lies on — 0 a B-rep vertex, 1 an edge, 2 a face — one per node: the lowest-dimension entity it lies on, which is the .msh format's own classification rule. CadaclysmFemMesh.node_entity says which entity of that kind.
CadaclysmFemMesh.node_entity
var node_entity: PackedInt32Array # read-only
Which vertex, edge or face each node lies on, read by the matching CadaclysmFemMesh.node_kind: an index into CadaclysmFemMesh.vertices, into CadaclysmFemMesh.edges, or into the body's faces.
CadaclysmFemMesh.face_count
var face_count: int # read-only
The body's faces; CadaclysmFemMesh.triangle_face and a CadaclysmFemMesh.node_kind of 2 index them.
CadaclysmFemMesh.edges
var edges: Array[Dictionary] # read-only
One FemEdge per B-rep edge, in the order a CadaclysmFemMesh.node_kind of 1 indexes them. Empty for a CadaclysmFemMesh.from_mesh body, which has no B-rep edges at all.
FemEdge.
One B-rep edge's chain of nodes, and where that chain breaks. nodes are this mesh's node indices in order along the edge, its end vertices included. runs says where the chain breaks: each entry is a start offset into nodes, and the nodes from one offset up to the next — the last offset running to the end — are a polyline of their own, with nothing joining across a boundary. The two ends either side of a boundary are two points of the edge with no mesh edge between them, a crack along the edge or a stretch of it sampled on one face only. (0,) is the ordinary answer, and a caller reading nodes as one polyline without looking here jumps the gap silently.
faces is (face_a, face_b) and ends is (end_a, end_b), the second of each a sentinel where there is none — an open body's rim, or both ends at one vertex. 0 is a real face and a real vertex, not a sentinel. Which end comes first is the first trim's direction and means nothing else: the pair bounds the edge, it does not orient it. closed where the nodes make one loop, never with more than one run; seam where one face bounds the edge twice, and both faces are then that same face.
id is the body's own edge id, not this mesh's edge index: CadaclysmFemMesh.edges is a densely renumbered subset of the body's edges, ascending by id, with every edge collapsed to a point left out, so edge 0 of a STEP body's mesh routinely has an id in the hundreds. Everything else that names an edge means the index — a CadaclysmFemMesh.node_kind of 1 read through CadaclysmFemMesh.node_entity, the third number of a CadaclysmFemMesh.open_edges or CadaclysmFemMesh.folded_edges row, and the edge_<i> physical group of CadaclysmFemMesh.msh_text() — and this is the one way back from any of them to the topology the file wrote.
No class: each edge is a Dictionary — id (an int), nodes and runs (PackedInt32Arrays, counted from zero), faces and ends (PackedInt64Arrays of two, wide enough for the NONE sentinel 4294967295, which an int32 would come out as -1), and closed and seam (bools). There is no chains() helper here: walk the runs with nodes.slice(runs[i], runs[i + 1] if i + 1 < runs.size() else nodes.size()).
CadaclysmFemMesh.vertices
var vertices: Array[Dictionary] # read-only
One FemVertex per B-rep vertex, in the order a CadaclysmFemMesh.node_kind of 0 indexes them. Empty for a CadaclysmFemMesh.from_mesh body.
FemVertex.
One B-rep vertex: node is the mesh node there, a sentinel where the mesh has none, which is ordinary rather than a fault — the analysis rebuilds a vertex wherever two trims meet, so a sphere has 48 of them where the mesh has two points, and a caller walking these skips the sentinel instead of reading it as a gap.
point is where the topology says the vertex is, in the same space and under the same placement as CadaclysmFemMesh.nodes — the file's own vertex rather than a mesh node, so the two can differ by the reader's rounding. Meaningless unless has_position: it is all zeros then, a point no geometry has and one a solver would read as a node at the origin.
No class: each vertex is a Dictionary — node (an int, the NONE sentinel 4294967295 where the mesh has none there), point (a PackedFloat64Array of three, in the same space as nodes and doubles for the same reason) and has_position (a bool).
CadaclysmFemMesh.open_edges
var open_edges: Array[PackedInt64Array] # read-only
Every crack, as (a, b, brep_edge): a directed mesh edge (a, b) with no (b, a), and the B-rep edge both nodes lie on where they share one.
Empty unless the body's topology is closed — for a B-rep body, whose mesh is otherwise not asked about at all. The census asks whether a body that ought to enclose a solid does, and an open one — a sheet, a bag of surfaces, a shell the file itself wrote open — makes no such claim to check: its rim is not a crack. So such a body reports CadaclysmFemMesh.watertight false with this and CadaclysmFemMesh.folded_edges both empty, and that trio of answers together is what says "not asked", not "nothing found".
A CadaclysmFemMesh.from_mesh body is the exception, and the opposite case. A bare mesh carries no topology to say whether it ought to close, so its census always runs over the welded triangles: an open one lists its cracks here with CadaclysmFemMesh.watertight false, a closed one reports CadaclysmFemMesh.watertight true with no topology consulted at all, and an empty census there really does mean "nothing found".
Each row is a PackedInt64Array of three, [a, b, brep_edge]. Int64 rather than Int32 because the NONE sentinel (4294967295) does not fit an int32, where it would come out as -1 — as an edge's faces and ends do not either.
CadaclysmFemMesh.folded_edges
var folded_edges: Array[PackedInt64Array] # read-only
Every fold, as CadaclysmFemMesh.open_edges reports a crack: a directed mesh edge used by more than one triangle, once.
A body can be folded without being open — a solid no thicker than a line leaves no hole for an open edge to find — and the closure census's own known-bad bodies are folds rather than open cracks. A caller that checks CadaclysmFemMesh.open_edges alone calls such a body sound. Empty under the same rule as CadaclysmFemMesh.open_edges.
CadaclysmFemMesh.crossings
var crossings: Array[PackedInt64Array] # read-only
Every pair of triangles that pass through each other, as (a, b) with a < b, sorted: an edge of one through the other's interior. Their B-rep faces are CadaclysmFemMesh.triangle_face at a and b.
Computed for every body, open or closed. CadaclysmFemMesh.watertight, CadaclysmFemMesh.open_edges and CadaclysmFemMesh.folded_edges are topological and cannot see a surface passing through itself; a mesh is ready for a volume mesher when it is CadaclysmFemMesh.watertight and this is empty — Gmsh refuses one that crosses. A copy.
CadaclysmFemMesh.watertight
var watertight: bool # read-only
The welded mesh closes — every directed mesh edge paired with its reverse and none used twice — and, for a B-rep body, so does the topology behind it. false for every B-rep body whose topology is not closed, whose mesh is then not asked about; read CadaclysmFemMesh.open_edges for what an empty census beside a false here does and does not mean.
A CadaclysmFemMesh.from_mesh body has no topology to ask of, so this says only that its triangles close: a closed render mesh reports true with nothing exact behind it at all.
Ready for a volume mesher means this and an empty CadaclysmFemMesh.crossings: this census is topological and cannot see a surface passing through itself.
CadaclysmFemMesh.from_mesh
var from_mesh: bool # read-only
This came from the scene's own mesh rather than from a B-rep: one face, every node on face 0, no edges and no vertices.
It is also which space the mesh is in. A B-rep body's FEM mesh is in the file's own units and axes, whatever Convention the scene was opened with, because it is taken off the B-rep — and a B-rep is in the file's own space for the reason CadaclysmBrep gives. A node with no B-rep falls back to the scene's mesh, which is converted, so that one comes back in the scene's convention, wound counter-clockwise about the outward normal even where the convention winds the other way.
And it is which contract the census is reporting under: read CadaclysmFemMesh.open_edges.
CadaclysmFemMesh.min_angle
var min_angle: float # read-only
The smallest interior angle of any triangle, in degrees. There is always one: a body that meshed to no triangles is a refusal, not a mesh.
CadaclysmFemMesh.worst_triangle
var worst_triangle: int # read-only
The triangle with that angle, as an index into CadaclysmFemMesh.triangles.
CadaclysmFemMesh.longest_edge
var longest_edge: float # read-only
The longest triangle edge, placed. The figure to check against CadaclysmNode.fem_mesh()'s max_size, and the only one that says what the mesh actually is. max_size bounds the boundary segments and merely targets the interior: measured at 1.03 x max_size on a face whose parameters run unevenly, where a full-size boundary piece met a much shorter one left by halving. One small enough beside the body to reach the mesher's own piece and station ceilings is not honoured at all.
CadaclysmFemMesh.msh_text()
func msh_text() -> String
The mesh as Gmsh 4.1 ASCII .msh text: an entity per B-rep vertex, edge and face, a volume where the body closes, and a physical group naming each.
Gmsh reads the file as written — measured with Gmsh 4.15: node and triangle counts equal to this mesh's, and a physical group per entity. To fill a closed body with tetrahedra, give Gmsh a volume of its own over the file's surfaces. In its Python API: gmsh.open(path), then faces = [t for _, t in gmsh.model.getBoundary([(3, 1)], oriented=False)], gmsh.model.geo.addVolume([gmsh.model.geo.addSurfaceLoop(faces)]), gmsh.model.geo.synchronize() and gmsh.model.mesh.generate(3). A plain generate(3) leaves a volume read from any .msh file empty — Gmsh's own saved meshes too — and gmsh.model.mesh.createGeometry() re-meshes the surfaces rather than keeping these triangles.
Prefer Gmsh's HXT algorithm: gmsh.option.setNumber("Mesh.Algorithm3D", 10) before generate(3). On these surfaces the default left tetrahedra of exactly zero volume (four in a 100 mm bar), which no solver can use, and HXT's worst element came out far better on curved bodies (a minimum SICN of 0.1 to 0.3 where the default's was 0.001). Then name the tetrahedra before saving: HXT fills the new volume rather than the file's own, and gmsh.write keeps only elements in a physical group, so without this step every tetrahedron is dropped from the file without a word — filled = [t for _, t in gmsh.model.getEntities(3) if len(gmsh.model.mesh.getElementsByType(4, t)[0])], gmsh.model.removePhysicalGroups(gmsh.model.getPhysicalGroups(3)) and gmsh.model.addPhysicalGroup(3, filled, name="body"). The saved file also lists a few interior nodes no element uses — points Gmsh's refinement tried and gave up on — so a solver reading it should keep only the tetrahedra's own nodes: each unused one is an unconstrained unknown.
On this side of the ABI the library's text is borrowed — a slot on this handle, replaced by the next call on it and gone when the mesh is freed. The wrapper copies it out on the way, so what a caller holds is a string of its own. The kernel library's own msh_text is the other way round: an owned string, released by the wrapper (cadaclysm_blacksmith_string_free at the ABI), two asks giving two independent texts. A reader porting one side's reasoning onto the other leaks or double-frees.
No unlicensed notice is printed here. CadaclysmNode.fem_mesh() gave it once when the mesh was built, and this ABI deliberately does not repeat it on either .msh call — where the kernel library notices on both of its writers and not on its builder. Each matches its own siblings, so moving the call to look like the other side breaks a convention.
It returns null, false or an empty value (the reason in Cadaclysm.last_error()) for a mesh the writer refuses, naming the field it cannot honour, and for a freed handle.
CadaclysmFemMesh.save_msh()
func save_msh(path: String) -> bool
CadaclysmFemMesh.msh_text() written to a path by the library itself: the same bytes from the same writer, straight to the file rather than through the borrowed slot, so a text asked of this handle on another thread cannot be freed under the write. It returns null, false or an empty value (the reason in Cadaclysm.last_error()) for a mesh the writer refuses or a file it cannot write, naming the path. No notice here either; see CadaclysmFemMesh.msh_text().
CadaclysmFemMesh.release()
func release() -> void
Give the mesh back, and with it every view taken from it. Idempotent; the collector or the scope does it otherwise.
Spelled release(), as CadaclysmBrep.release is, and not free(): Godot gives every Object a free() of its own, which deletes the object and is an error on a RefCounted — which every class here is. Nor could this be spelled free anyway: measured, Object.call intercepts that name before the class's own methods are looked at, so a free() registered here is never reached and the handle stays alive. There are no views to give back with it, every array this class hands out being a copy, so what it ends is the handle and the calls that read through it — each of which then leaves the FEM mesh was released in Cadaclysm.last_error(). CadaclysmFemMesh.released says whether it has run; a second call is a no-op, and letting the last reference go does it too.
CadaclysmFemMesh.released
var released: bool # read-only
Whether CadaclysmFemMesh.release() has run.
Surfaces and Face
A node's faces as exact surfaces and trims: what CadaclysmNode.surfaces returns. Iterate it for Face values. In the file's own frame; CadaclysmScene.surface_matrix brings it into the scene's.
No class: surfaces is an Array of Dictionaries, one a face.
Face.
One trimmed face. kind is the surface: 0 plane, 1 cylinder, 2 cone, 3 sphere, 4 torus, 5 revolution, 6 extrusion, 7 NURBS, 8 sum. origin, ax, ay, az are its frame, scalars its kind-dependent sizes (radius, angle…) and domain its (u min, v min, u max, v max). loops holds the trim loops as (u, v) points, each closing implicitly; profile, profile2 and nurbs carry what a swept or NURBS surface needs. reversed flips the normal; transposed swaps u and v. The C header's CadaclysmFace is the full description.
Each face is a Dictionary: kind, kind_name (the surface's name, "plane"...), reversed, transposed, origin, ax, ay, az (Vector3s), domain and scalars (Vector4s), loops (an Array of PackedVector2Array), profile and profile2 (PackedVector4Arrays) and nurbs (a PackedFloat32Array).
Tolerances
What a file declares about its own precision, as a named tuple: absolute, a length in the file's own unit, and angular, in radians — each none where the file said nothing. What CadaclysmScene.tolerances returns.
A Dictionary: absolute and angular, NAN where nothing is declared (Godot has no null number).
AABB
An axis-aligned box: what CadaclysmNode.bounds and CadaclysmScene.bounds return. All zeros means "nothing here".
Bounds are Godot's own AABB.
AABB.has_surface
Whether this is the all-zero box that stands for nothing.
has_surface() is false for it; == AABB() tells the all-zero box exactly.
Attribute
One thing the file said about a node: what CadaclysmNode.attributes lists.
No class: an attribute is a Dictionary, {name, kind, value, text}.
Attribute.kind
Which kind of value it holds — a ValueKind. Lets a caller tell a reference from prose, or total the numbers.
The kind key, a String: "none", "text", "integer", "real", "boolean", "list" or "reference".
Attribute.value
The value, in the language's own type where it has one for the kind.
The value key: a String, an int, a float, a bool or null (lists and references arrive as Strings).
Attribute.text
The value rendered for display, identically in every wrapper: true/false, reals in their shortest exact form, lists as [a, b, c].
The text key.
Convention
The coordinate space to open a file into. The library converts on the way out, so a caller names the space it draws in and reads geometry already in it — nothing to rotate or scale afterwards.
No class: a convention is named by a String in open_with's convention option — "y-up" (the default: Godot's own space), "native", "unreal", "unity", "blender" — or given as the number Cadaclysm.convention(name) returns.
Convention.
The presets: NATIVE keeps the file's own axes and units; UNREAL is Z up, left-handed, centimetres; UNITY Y up, left-handed, metres; Y_UP Y up, right-handed, metres (glTF, three.js, most real-time engines); BLENDER Z up, right-handed, metres.
"native", "unreal", "unity", "y-up" and "blender": Strings, in open_with's convention option.
Convention.FILE_UNITS
Combine with a preset to keep its axes but the file's own units.
+file-units after the name: "unreal+file-units".
Convention.UV_WORLD
Combine with a preset to ask for world-scale texture coordinates in CadaclysmMesh.uvs. Off by default: eight bytes a vertex nobody asked for.
open_with's uv_world option: {"uv_world": true}.
Cadaclysm.convention()
static func convention(name: String) -> int
A convention from a name a user typed: unreal, or unreal+file-units. An unknown name returns null, false or an empty value (the reason in Cadaclysm.last_error()) listing the accepted ones, rather than silently reading as native.
Returns the convention's number, which open_with's convention option also takes; -1 for a name it does not know.
ValueKind
Which kind of value an Attribute holds.
No enum: an attribute's kind is its name as a String, "text", "integer"...
ValueKind.
TEXT, INTEGER, REAL, BOOLEAN; LIST (the elements rendered as [a, b, c]); REFERENCE (another entity, by the id the file gave it, so it can be followed rather than shown as prose); NONE for an attribute that had no value.
No enum: an attribute's kind is its name as a String, "text", "integer"...
Manifold
Whether a body's faces make a manifold — every edge bordered by one face or two, the faces round every vertex one fan — told from its topology rather than a mesh: what a brep's manifold and the kernel's CadaclysmSolid.manifold return. Orientation is not asked. The topology is the file's: faces that name no shared edge (IGES, each surface its own sheet; an IFC face written as one polygon) read as open however well they meet in space.
No class: a Dictionary with these keys.
Manifold.boundary_edges
Edges only one face borders: a sheet's rim, a hole in a shell.
The boundary_edges key.
Manifold.non_manifold_edges
Edges three or more faces border: a fin, or two solids meeting along a line.
The non_manifold_edges key.
Manifold.non_manifold_vertices
Vertices whose faces make more than one fan: two solids touching at a corner.
The non_manifold_vertices key.
Manifold.is_manifold
No non-manifold edge or vertex: a manifold, possibly with a boundary.
The is_manifold key.
SewReport
What CadaclysmBrep.sew did, as plain data: the edges it joined, the free edges before and after, how many groups of free edges it left free, the widest gap it sewed, and the two tolerances it used.
The C API and the other wrappers have it; the Godot CadaclysmBrep has no sewed.
SewReport.pairs
How many pairs of free edges it joined into one shared edge.
The C API and the other wrappers have it; the Godot CadaclysmBrep has no sewed.
SewReport.free_before
Free edges (those only one face borders) before sewing.
The C API and the other wrappers have it; the Godot CadaclysmBrep has no sewed.
SewReport.free_after
Free edges after sewing.
The C API and the other wrappers have it; the Godot CadaclysmBrep has no sewed.
SewReport.refused
How many groups of free edges between the same two vertices it left free: too far apart for the tolerance, or more than two.
The C API and the other wrappers have it; the Godot CadaclysmBrep has no sewed.
SewReport.worst_gap
The widest gap between two curves it sewed.
The C API and the other wrappers have it; the Godot CadaclysmBrep has no sewed.
SewReport.tolerance
How close two curves had to lie, as used: by default vertex.
The C API and the other wrappers have it; the Godot CadaclysmBrep has no sewed.
SewReport.vertex
How close two edges' ends had to coincide, as used: by default the rounding CadaclysmBrep.manifold() merges vertices at.
The C API and the other wrappers have it; the Godot CadaclysmBrep has no sewed.
HealthReport
What is wrong with a body, as plain data: what CadaclysmBrep.health() returns. Nothing in it moves the body. It lists the free edges (the sides only one face bounds) and the wires they chain into, the features below the tolerance, the loose edges, what sewing would join and leave, and, if asked for, where the body's mesh cracks. The tolerance is an absolute length, as Rhino's model tolerance is; it is reported back as used.
No class: health returns a Dictionary with these keys — the rows as Arrays of Dictionaries, cracks a Dictionary or null.
HealthReport.tolerance
The length below which a feature is small and a gap closes, as used: by default 1e-4 times the body's diagonal. A value that is not finite and positive (NaN, infinite, zero or negative) takes the default.
The tolerance key.
HealthReport.extent
The body's diagonal, the length the default tolerance is a fraction of.
The extent key.
HealthReport.free_edges
The free edges, as FreeEdge rows, each wire's edges together and in order.
The free_edges key.
HealthReport.loose_edges
How many shared edges are loose: the two faces' sides along the edge lie further apart than the larger of the tolerance the body recorded for the edge and the one given.
The loose_edges key.
HealthReport.sew_pairs
How many pairs of free edges CadaclysmBrep.sew (or CadaclysmSolid.join_sheets()) would join: those with shared_ends 2.
The sew_pairs key.
HealthReport.cracks
Where the body's mesh cracks, as a Cracks; null unless the call asked for the mesh. Cracks are only counted on a closed body: for an open one the census is empty by design, so watertight false beside no edges means "not asked", not "nothing found".
The cracks key.
HealthReport.worst_gap
The widest gap between a free edge and its partner. A rim has no true partner, so it reads as a gap the size of the part.
The worst_gap key.
HealthReport.wire_edges
The free edges of one wire, by its number in wires, in order.
No helper: a Dictionary has no methods, so it is free_edges.slice(w.first, w.first + w.count) for wire w.
FreeEdge
One free edge: a side only one face bounds, with its nearest partner. The partner is the nearest free edge other than a neighbour on its own wire, so the rim of a sheet reads as a gap the size of the part rather than as a crack, and a real seam reads as a small gap. The partner is a row index into free_edges.
No class: each row of free_edges is a Dictionary with these keys; edge and partner are -1 for none.
FreeEdge.partner
The nearest free edge across the gap, as an index into free_edges; null if there is none.
The partner key; -1 for none.
FreeWire
A chain of free edges end to end.
No class: each row of wires is a Dictionary with these keys.
FreeWire.first
The row of free_edges it starts at: its edges are the rows first to first + count.
The first key.
SmallFeature
Something below the tolerance.
No class: each row of small is a Dictionary with these keys, kind a String.
SmallFeature.kind
What it is: short_edge, collapsed_edge, sliver_face, tiny_face, tiny_body or small_hole (an inner loop whose edges are all free, below the tolerance in area or width: a pinhole in an open sheet; a hole with walls is not one).
The kind key.
Cracks
What a mesh of the body shows, asked for with mesh=True: the call meshes the body. Only a closed body is counted: an open one's census is empty by design, as its rim is not a crack.
No class: a Dictionary with these keys, edges a PackedInt64Array; the report's cracks is null unless mesh was asked for.
HealReport
What CadaclysmBrep.heal() did, as plain data: the fixes it made, the small features it left and why, and the body's health before and after at the tolerance it healed at. Indices are the input body's.
No class: heal returns a Dictionary {body, report} — body the new body, report a Dictionary with these keys.
HealReport.tolerance
The tolerance it healed at, as used: by default 1e-4 times the body's diagonal.
The tolerance key.
HealReport.moved
The furthest any trim the result keeps moved, measured: the edited trims against the originals. Not the same measure as a HealFix's moved, which is how far that fix's merged vertices moved: a curve can move further than its ends, and the trims of a dropped edge are not measured at all, so either can be the larger.
The moved key.
HealReport.guarded
Whether the guard refused a fix: the full result was worse (less closed, more free or non-manifold edges, or no faces left), so the face pass's fixes were refused and the rest kept, or, if that was still worse, every fix was refused and the body came back as it was. Refused fixes are listed as body_guard.
The guarded key.
HealReport.fixes
What was done, as HealFix rows, in the order it was done. A short edge removed as part of a face is that face's fix and is not listed again.
The fixes key.
HealReport.nonmanifold_before
The input's edges three or more faces share.
The nonmanifold_before key.
HealFix
One small feature removed.
No class: each row of fixes is a Dictionary with these keys.
HealFix.moved
How far the vertices this fix merged moved. The report's own moved is a second measure, how far any surviving trim moved, measured; either can be the larger.
The moved key.
HealRefusal
One small feature left, and why.
No class: each row of refused is a Dictionary with these keys, why a String.
HealRefusal.why
would_empty_loop (removing the edge would leave a loop with no trims: the face pass's case), closed (both ends already one vertex: a tiny closed curve), seam (one face uses the edge twice), chain (the vertices to merge span more than the tolerance), neighbours_part (a sliver's two long sides part by more than the tolerance), uneven (a sliver's long edges are not two, one per side), non_manifold (a sliver side three or more trims share), has_holes (the sliver or tiny face has inner loops), body_guard (the guard refused the fix), toggled (its kind switched off) or unsupported (a tiny body, which healing never removes).
The why key.
RecognizeReport
What CadaclysmBrep.recognize() did, as plain data: the faces and edges given an analytic kind, the faces left free-form and why, and the tolerance it fitted to. Faces and edges are numbered as in the body, before and after alike.
No class: recognize returns a Dictionary {body, report} — body the new body, report a Dictionary with these keys, the rows as Arrays of Dictionaries.
RecognizeReport.tolerance
The tolerance it fitted to, as used: by default 1e-6 of the body's extent.
The tolerance key.
RecognizeReport.edges
The edges whose curve was given an analytic kind, as RecognizedEdge rows, in edge order.
The edges key.
RecognizeReport.worst_face
The furthest any face taken lies from its analytic surface; 0 when none was taken.
The worst_face key.
RecognizeReport.worst_edge
The furthest any edge taken lies from its analytic curve; 0 when none was taken.
The worst_edge key.
RecognizedFace
One face given an analytic kind.
No class: each row of faces is a Dictionary with these keys, kind a String.
RecognizedFace.deviation
The furthest any sample of the face or point of its edges lies from the analytic surface.
The deviation key.
RecognizeRefusal
One face left free-form, and why.
No class: each row of refused is a Dictionary with these keys, why a String; closest is NAN for none.
RecognizeRefusal.why
no_kind (no kind fits within the tolerance), mixed_normals (its normals point both ways), parameter_trims (a trim in its surface's parameters could not be lifted to space) or too_few_samples.
The why key.
RecognizeRefusal.closest
For no_kind, the deviation of the kind that came closest; null otherwise.
The closest key; NAN for none (Godot has no null number).
RecognizedEdge
One edge whose curve was given an analytic kind.
No class: each row of edges is a Dictionary with these keys, kind a String.
RecognizedEdge.deviation
The furthest any point of the curve or the edge lies from the analytic curve.
The deviation key.
Errors
A call into the library failed; the message is the library's own reason. One type for every reader failure.
No error type: GDScript has no exceptions. A call that fails returns null (or false, -1 or an empty value), reports the reason with push_error, and leaves it in Cadaclysm.last_error() until the next call that works.
Building solids
Frames and axes
A frame is twelve numbers: an origin, then the x, y and z axes, each three numbers (0,0,0, 1,0,0, 0,1,0, 0,0,1 is the world). A profile is drawn in its frame's x/y and extruded along its z. An axis is six numbers: a point and a direction, which need not be unit. CadaclysmWorkplane.xy() and friends start on the three world planes; CadaclysmSolid.face_frame() gives the frame on a face. A CadaclysmFrame builds one for you — CadaclysmFrame.xy() at any origin, CadaclysmFrame.at() from a point and a normal — and checks that its axes are square and right-handed, which a bare twelve numbers are not.
Pass a CadaclysmFrame, a Transform3D (square, unscaled axes), twelve numbers or four triples. A point is a Vector3 (Vector2 in a sketch) or an array of numbers — [1.5, 2.0, 0.0] keeps a double's precision where a Vector3 holds floats. An axis is two arguments, a point and a direction.
Module functions
The kernel's own module: its version, licence, STEP and .brep writers. The kernel and the reader are one library, so its licence call and the reader's set the same licence.
CadaclysmBlacksmith.write_step()
static func write_step(path: String, solids: Array, schema: String = "", unit: String = "mm") -> bool
Write several solids as one STEP file, each its own body. unit is mm, m or in. schema is left out for AP203 (built in — no file needed; AP242 when any solid, face or edge is coloured, since AP203 has no colour entities), the name of another built-in schema such as AP242's AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF (AP214's AUTOMOTIVE_DESIGN cannot carry the writer's mechanical_context), or a custom EXPRESS schema: a path to its .exp or its text. Colours from coloured and edges_coloured are written as STEP styling wherever the schema has it, a solid's read back as the node's colour; a named schema without it writes the solids bare.
CadaclysmBlacksmith.write_step_text()
static func write_step_text(solids: Array, schema: String = "", unit: String = "mm") -> String
The same STEP file as text, for a caller that stores or sends it rather than writing a file.
CadaclysmBlacksmith.write_step_assembly
Write an assembly as one STEP file: parts names each solid, in its own coordinates, and each is written once as its own product; placements lists (name, frame) pairs, each an occurrence of that part at that frame (right-handed and orthonormal), all under one root product. A reader tessellates a part once however many times it is placed, and shows each placement under its part's name. schema and unit as CadaclysmBlacksmith.write_step().
Not in this wrapper: build an Assembly and write it with step or step_text.
CadaclysmBlacksmith.write_step_assembly_text
The same assembly as STEP text.
Not in this wrapper: build an Assembly and write it with step or step_text.
CadaclysmBlacksmith.write_brep()
static func write_brep(path: String, solids: Array) -> bool
Write several solids as one OCCT .brep file, each its own solid under one compound (a single solid is the file's root): the exact surfaces and curves, with a curve in each face's own parameters for every edge, so Open CASCADE's BRepTools::Read gives a shape its BRepCheck_Analyzer finds valid. No unit is declared — a .brep carries none — so the numbers written are the numbers held. The library writes the file itself.
CadaclysmBlacksmith.write_brep_text()
static func write_brep_text(solids: Array) -> String
The same .brep file as text.
CadaclysmBlacksmith.write_sat()
static func write_sat(path: String, solids: Array, unit: String = "mm") -> bool
Write several solids as one ACIS SAT file, each its own body: planes, cylinders, cones, spheres and tori as their own records, splines and swept surfaces as exact NURBS, in the layout Rhino's own exporter writes. unit is mm, m or in and goes into the header as millimetres per unit. The library writes the file itself, so a refusal names it.
CadaclysmBlacksmith.write_sat_text()
static func write_sat_text(solids: Array, unit: String = "mm") -> String
The same SAT file as text.
CadaclysmBlacksmith.write_3dm
Write several solids as one Rhino .3dm (version 8, which Rhino 8 and 9 open), one object each: its exact brep — the surfaces and trims as they are — or, where a body has no exact form there, its mesh, with a warning saying so. Each object is named as its solid is and coloured with the solid's own colour, each painted face with its own (Rhino keeps it on the face; a body written as its mesh carries them as vertex colours; an edge's own colour has no place in a .3dm and is left out, with a warning saying so), and carries the solid's attributes as user text. unit is mm, m or in and is the file's unit: the numbers written are the numbers held. The library writes the file itself, so a refusal names it.
Not in the Godot add-on yet: write the solid with write_step or write_sat instead.
CadaclysmBlacksmith.rhino3dm_bytes
The same .3dm file as bytes.
Not in the Godot add-on yet: write the solid with write_step or write_sat instead.
CadaclysmBlacksmith.mesh_file()
static func mesh_file(solids: Array, format: String = "stl", names: PackedStringArray = PackedStringArray(), looks: PackedFloat64Array = PackedFloat64Array(), tolerance: float = f64.NAN) -> PackedByteArray
Several solids meshed at tolerance — each the mesh CadaclysmSolid.mesh() hands out — as one file's bytes in format: "stl" (binary, every solid in one body), "stl-ascii" (one body named as the first solid), "obj" (one named object a solid, no material library), "glb" or "gltf" (one named node a solid in a material of its own; the .gltf with its buffer embedded), "3mf" (a 3MF package, one named object a solid, in millimetres), "ply" (binary little-endian) or "ply-ascii" (PLY, every solid's triangles in one body). 3MF and PLY carry the solids' colours — each face its own where it was painted, else the solid's; 3MF a colour a triangle, PLY a colour a vertex — and none when no solid is coloured. names one a solid (left out: each solid's own name, else Solid 1, Solid 2, ...); looks one a solid, six numbers each — linear r, g, b, a, metallic, roughness in 0..1 — the glTF's materials (left out: each solid's own colour); the other formats ignore them. No solids, an unknown format, or names or looks not one a solid returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmBlacksmith.write_drawing_svg()
static func write_drawing_svg(path: String, solids: Array, profiles: Array) -> bool
Several solids and profiles' wireframe as one SVG, any mix and any order: a <g id="solid-<i>"> per solid then a <g id="profile-<i>"> per profile, each stroked in its own colour where it carries one — a solid's edge colour first, then its body colour (a face colour says nothing about a wireframe) — and the keywords' stroke= otherwise. The keywords are CadaclysmScene.svg()'s own: view= (front, back, left, right, top, bottom, iso), az=/el= over it, up= (default z: neither a solid nor a profile carries a convention of its own to default it from), fov= (0, the default, is orthographic), size=, margin=, tolerance=, stroke= and background= ("#rgb", "#rrggbb" or a CSS colour name in every language, beside that language's own numeric form; background= null for transparent), width= (the stroke's, in page units), edges=, curves=, isocurves=, polylines= (which line sets are drawn; edges by default), and silhouettes= (also draw where each solid's surfaces turn away from the eye — the outline a sphere has no edge for, on by default: a sphere's and a torus's only curves are the seams where their one face meets itself, which are not edges of the body and are never drawn, so without it those two draw a blank page. A line set in its own right, so silhouettes= with edges= off draws the outline alone).
hidden= draws the solids through hidden-line removal, the solids on the page hiding one another, seen from the eye the other words describe: null (the default) draws every line, "removed" only what is seen — edges in solid-<i>, outlines in solid-<i>-silhouettes — and "dashed" adds the hidden lines, dashed, in a solid-<i>-hidden group. Profiles neither hide nor are hidden.
A list of solids alone draws exactly as it always did. The SVG is the drawing itself: with path, writes it to the file and returns null; without, returns the SVG text. Both lists empty returns null, false or an empty value (the reason in Cadaclysm.last_error()); so does anything in them that is neither a solid nor a profile, a refused option, or a failed write.
CadaclysmBlacksmith.hlr()
static func hlr(solids: Array, options: Dictionary) -> CadaclysmHlr
Hidden-line removal of several solids, each where it stands, every solid hiding the others: what a drawing of them shows, and what it shows only dashed, as an CadaclysmHlr. A parallel view along direction (from the eye toward the model; default (0, 1, 0), the front) with up the page's up (default (0, 0, 1)), or, with eye, a perspective from eye toward target — not both direction and eye. Each line is a span of an edge's own curve or of a silhouette, exact as rational cubic Béziers; iso above 0 adds that many isocurves each way on every face; smooth_angle (radians, default one degree) is how near tangent two faces are for the edge between them to be "smooth". tolerance null or 0 is the solids' effective tolerance. View coordinates are the camera's, x right and y up, the origin on the sight line through the solids' box centre. No solids, a zero direction or up, up along the sight line, eye on target, or an angle or tolerance out of range returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmBlacksmith.hlr_mesh()
static func hlr_mesh(meshes: Array, options: Dictionary) -> CadaclysmHlr
CadaclysmBlacksmith.hlr() of triangle meshes (CadaclysmTriangleMesh), each a solid of flat triangles: its lines are the edges whose two triangles turn by more than feature_angle (radians, default thirty degrees), the edges with one triangle, and the edges between a triangle facing the eye and one facing away (the outlines); the triangles hide exactly. Each line's source is a mesh edge, its two vertices. The same view words as CadaclysmBlacksmith.hlr(), bar iso and smooth_angle.
CadaclysmBlacksmith.projected_outline()
static func projected_outline(solids: Array, options: Dictionary) -> Array[CadaclysmProfile]
The boundary of the union of the solids' projections, as closed CadaclysmProfiles in CadaclysmBlacksmith.hlr()'s view coordinates: each outer loop counter-clockwise with its holes clockwise inside it, so a through hole seen along its axis is a hole. The silhouette a part casts — what a laser cuts or a pocket clears — ready to extrude. CadaclysmBlacksmith.hlr()'s view words, bar iso and smooth_angle.
CadaclysmBlacksmith.dxf_profiles()
static func dxf_profiles(text: String, tolerance: float = f64.NAN) -> Array[CadaclysmProfile]
A DXF file's closed loops as CadaclysmProfiles, the way back from a drawing: its lines, arcs, circles, ellipses, polylines and splines (blocks inserted) chained end to end within tolerance (null or 0: the effective tolerance over the drawing's extents) into closed loops, each hole nested in the loop around it. Text that is not DXF returns null, false or an empty value (the reason in Cadaclysm.last_error()), naming the line it stopped at.
CadaclysmBlacksmith.HLR_KINDS
The kinds of a hidden-line view's lines, in the C API's numbering from 0: "sharp" (an edge between faces that meet at an angle), "smooth" (an edge between faces near tangent), "outline" (a silhouette, where a surface turns away from the eye), "iso" (an isocurve) and "boundary" (an edge with one face, a sheet's rim).
CadaclysmHlrLine.kind is the kind's name as a String: "sharp", "smooth", "outline", "iso" or "boundary".
CadaclysmBlacksmith.SQUISH_DEFORMATIONS
The deformations CadaclysmSolid.squish() takes, by name, and their C API codes: free 0, stretch_mostly 1, stretch_only 2, compress_mostly 3 and compress_only 4.
CadaclysmSolid.squish takes the deformation's name: "free", "stretch_mostly", "stretch_only", "compress_mostly" or "compress_only".
CadaclysmBlacksmith.PAGE_UNITS
The units a CadaclysmPage can be drawn in, by name, and the DXF $INSUNITS code each is written as: unitless 0, in 1, ft 2, mm 4, cm 5 and m 6.
CadaclysmPage.create takes the unit's name: "mm" (the default), "cm", "m", "in", "ft" or "unitless".
CadaclysmBlacksmith.default_schema()
static func default_schema() -> String
Where an ap203.exp file is found (CADACLYSM_SCHEMAS, else schemas/ in a parent). No longer needed to write STEP: the kernel's AP203 is built in.
CadaclysmBlacksmith.version()
static func version() -> String
The version of the kernel library actually loaded.
CadaclysmBlacksmith.flavour
Which library the kernel loaded: "full", "kernel-reader" or "kernel" for a flavour of the single cadaclysm library, and "kernel" for the separate cadaclysm_blacksmith of earlier releases. Loading the kernel from the reader flavour returns null, false or an empty value (the reason in Cadaclysm.last_error()) at once, naming the flavours that have a kernel; a call the loaded flavour does not have (a writer or a part on "kernel") returns null, false or an empty value (the reason in Cadaclysm.last_error()) when it is made.
Not in the Godot add-on yet.
CadaclysmBlacksmith.features
The features the kernel's library was built with, comma-separated, as the reader's query answers them; empty for the separate cadaclysm_blacksmith.
Not in the Godot add-on yet.
CadaclysmBlacksmith.build_date()
static func build_date() -> String
When the loaded kernel was built, YYYY-MM-DD.
CadaclysmBlacksmith.build()
static func build() -> String
The loaded kernel's build: its version, the commit and branch it was built from ("unknown" built from no checkout), when (a release's pinned date), and its build date — {"branch": "master", "commit": "7e4b5058e", "date": "2026-11-14", "time": "2026-11-14T10:22:31Z", "version": "0.14.2"}. What an app shows as the cadaclysm it runs on. Python returns it as a dict and JavaScript as an object; the other languages return the JSON text.
CadaclysmBlacksmith.pair_freedom_count()
static func pair_freedom_count(kind: String) -> int
How many freedoms a pair kind has, so a caller can size CadaclysmAssembly.pair()'s ranges. 0 for an unknown name, and for fully_constrained, which has none.
CadaclysmBlacksmith.license()
static func license(text_or_path: String) -> bool
Load a licence into the kernel — the text, or a file's path. The reader has its own call; the same file works for both.
CadaclysmBlacksmith.license_info()
static func license_info() -> String
One line about the kernel's licence, or unlicensed. Never null.
CadaclysmBlacksmith.license_notice_count()
static func license_notice_count() -> int
How many unlicensed notices the kernel has printed to stderr in this process.
CadaclysmBlacksmith.set_option()
static func set_option(name: String, value: float) -> bool
Set a kernel option, by its name, for the whole process from the next call on — every thread, every solid. The options are numbers under stable names, one call for all of them, so an option added later needs no new function:
boolean.mesh_budget (default 500000): the most triangles a boolean (join, cut, common, split) builds its trees from, its two solids' meshes together. Past it the boolean refuses with a tolerance error rather than running for minutes or hours. A whole number, at least 1, or infinity for no limit.
boolean.finest_tolerance (default 1e-8): the finest tolerance a boolean takes, as a share of how far its two solids reach; under it the boolean refuses before meshing anything. From 0 (no floor) to below 1.
profile_boolean.point_budget (default 8000000): the most points a profile boolean follows its two profiles' arcs and splines with. Past it the boolean refuses with a tolerance error; 8 million is about 128 MB. A whole number, at least 1, or infinity for no limit.
measure.default_accuracy (default 1e-7): the relative accuracy CadaclysmSolid.mass(), CadaclysmSolid.edge_length(), CadaclysmProfile.length() and the arc-length samples (CadaclysmSolid.edge_point_at_length(), CadaclysmProfile.point_at_length() and their divides) refine to when they are asked for 0, the default. Above 0 and below 1. CadaclysmSolid.oriented_box() has its own default, 1e-5, and does not read it.
step.validation_properties (default 0): whether a STEP part file (CadaclysmSolid.step(), CadaclysmBlacksmith.write_step()) carries each body's geometric validation properties — the surface area, the volume and the centroid this kernel measures for it, stated in the file so the kernel that reads it can check the transfer against its own measurement of the same geometry. 1 to write them, 0 not to. Off by default because it measures every body in the file at step.validation_accuracy. With no schema named the file moves to AP242, as a colour moves it, since AP203's first edition has no entity to state a property with; a named schema that cannot state them returns null, false or an empty value (the reason in Cadaclysm.last_error()) rather than writing the file without the figures. A body whose measurement is refused is written without properties, and the file is still written. An assembly file (CadaclysmBlacksmith.write_step_assembly) never carries them. A reader finds them again on the node, under CadaclysmNode.attributes.
step.validation_accuracy (default 1e-5): the relative accuracy each body is measured to for those figures — 1e-5, as CadaclysmSolid.oriented_box()'s own default, not measure.default_accuracy's 1e-7, because 1e-7 costs tens of seconds on a free-form body and a file is a whole model of them. Above 0 and below 1. STEP has no field for an error bound, so the figures written are as good as this and no better: a receiver who wants to compare against a finer figure asks for a finer one here.
tolerance.relative (default 1e-4): the share of a solid's size a verb given no tolerance (0, or none where the language has it) works at, unless the solids declare a looser absolute tolerance — see CadaclysmBlacksmith.effective_tolerance(). Above 0 and below 1.
tolerance.angular (default one degree, in radians): the angle that stands in where nothing declares one. Above 0 and below a right angle.
A name that is not an option, or a value the option does not take, returns null, false or an empty value (the reason in Cadaclysm.last_error()) and changes nothing, saying which and what it takes.
CadaclysmBlacksmith.option()
static func option(name: String) -> float
A kernel option's value, by its name: what CadaclysmBlacksmith.set_option() last set, else its default (see CadaclysmBlacksmith.set_option() for the names). A name that is not an option returns null, false or an empty value (the reason in Cadaclysm.last_error()), listing the ones there are.
CadaclysmBlacksmith.brep_layout_id()
static func brep_layout_id() -> String
How the loaded kernel lays a brep out in memory: its compiler, target and source. CadaclysmSolid.from_node() works only where this equals the reader's CadaclysmBrep.layout_id() — both modules on the same release of the library.
CadaclysmBlacksmith.library_path()
static func library_path() -> String
Where the kernel library was found: CADACLYSM_BLACKSMITH_LIBRARY first, then as the reader's.
CadaclysmBlacksmith.thread_sizes()
static func thread_sizes() -> Array[CadaclysmThreadSize]
The whole thread size table as CadaclysmThreadSizes: ISO metric coarse M1 .. M64, ISO metric fine M8x1 .. M64x4, UNC #1 .. 1-1/2", UNF #0 .. 1-1/2", in that order, each by ascending major.
CadaclysmBlacksmith.thread_size()
static func thread_size(designation: String) -> CadaclysmThreadSize
The CadaclysmThreadSize designation names: the exact designation first, then forgiven — case and spaces ignored, "M10" the coarse row, "M10x1.25" the fine one, "1/4-20" the UNC or UNF row of that TPI. A designation no row matches returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmBlacksmith.gear_centre_distance_involute()
static func gear_centre_distance_involute(module: float, teeth_first: int, teeth_second: int, shift_first: float = f64.NAN, shift_second: float = f64.NAN, pressure_angle: float = f64.NAN) -> float
The centre distance of two involute gears of module, teeth_first and teeth_second teeth, in mesh without backlash: module (z1 + z2) / 2 cos(alpha) / cos(alpha_w), the working angle alpha_w solved from the shifts. null is the default: shifts 0, pressure_angle 20 degrees (radians). A module not positive, fewer than 4 teeth, a pressure angle outside (0, pi/4) or shifts that leave no working angle returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmBlacksmith.angle()
static func angle(a: Variant, vertex: Variant, b: Variant) -> float
The angle at vertex between the arms to a and to b, in radians 0 to pi. A point not finite, or an arm of no length, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmBlacksmith.effective_tolerance()
static func effective_tolerance(solids: Array) -> float
The tolerance a verb given none — 0, or none where the language has it — works at over solids: the larger of the loosest absolute tolerance they declare (CadaclysmSolid.tolerances()) and tolerance.relative (see CadaclysmBlacksmith.set_option()) times the largest of their sizes, never finer than their coordinates can represent. Every verb that takes a distance tolerance (booleans, fillets, shells, splits, sections, hits, meshes, curve fits, profile verbs) reads it so; the wrappers' own defaults (0.05 for a boolean) stay what they are. 0 for no solids, or solids with nothing to size by, which a verb refuses.
CadaclysmBox.boxes_apart()
static func boxes_apart(a: CadaclysmBox, frame_a: Variant, b: CadaclysmBox, frame_b: Variant) -> bool
True only if box a at frame_a and box b at frame_b cannot touch — a separating axis among the boxes' face normals and edge-direction crosses; touching is not apart. Sharper than moving each box (CadaclysmBox.moved()) and asking CadaclysmBox.overlaps(), which boxes the *result* on the world axes again and so can call two oriented boxes overlapping when they are not (two unit boxes, the second turned 45 degrees about z and moved 2.3 along x: their world boxes overlap, but the boxes themselves do not touch). frame_a or frame_b not twelve finite numbers or not rigid returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmBlacksmith.clash()
static func clash(parts: Array, others: Variant, clearance: float = 0.0, tolerance: float = 0.05, allowed: PackedInt32Array = PackedInt32Array()) -> Variant
Every pair of parts — or, with others, every part of parts against every part of others — that penetrates, touches or lies within clearance of the other, as CadaclysmClash rows, the solids as they stand. It is the question CadaclysmSolid.closest() and CadaclysmCollider.check() leave open: not how far apart two parts are, nor only whether they overlap, but which pairs are in trouble and how. A row's kind is decided in this order: "penetrating" where the volumes overlap; "touching" where the boundaries are within tolerance of each other; "too_close" where they are apart by more than tolerance but less than clearance; "refused" where the pair could not be decided. A pair further apart than clearance gives no row, and with clearance 0 there are no "too_close" rows. tolerance is the meshing tolerance, absolute, in model units (0.05 by default); a distance is exact to within it. In a row a indexes parts and b indexes others (or parts again, when there are no others; then a < b). Rows come in pair order. allowed is pairs of part indices never tested — designed contacts — each exactly two integers; with others a pair is (index in parts, index in others). A negative or non-finite clearance, a tolerance not positive and finite, an allowed pair that is not two indices or one out of range, an empty others, or a part that is not a closed solid returns null, false or an empty value (the reason in Cadaclysm.last_error()); the kernel's own words are prefixed clash:. For the same parts moved pose after pose, build a CadaclysmCollider and ask CadaclysmCollider.clash(). Whether the parts meet on the way from one pose to the next is CadaclysmBlacksmith.swept_clash()'s question.
others comes second and has no default: pass null for one set. allowed is a flat PackedInt32Array, as CadaclysmCollider's.
CadaclysmBlacksmith.swept_clash()
static func swept_clash(parts: Array, poses: Array, others: Variant, other_poses: Variant, clearance: float = 0.0, tolerance: float = 0.05, resolution: float = 1e-3, max_steps: int = 100000, allowed: PackedInt32Array = PackedInt32Array()) -> Variant
Every pair of parts — or, with others, every part of parts against every part of others — that penetrates, touches or comes within clearance of the other anywhere on a path, as CadaclysmSweptClash rows: CadaclysmBlacksmith.clash()'s question asked of the motion, not only of the poses. Each part is its own group: pose k of poses is one CadaclysmFrame (or twelve numbers) per part of parts, and pose k of other_poses one per part of others; others and other_poses go together, and the two have as many poses. The motion between poses, the guarantee, resolution and max_steps are CadaclysmCollider.swept_clash()'s; clearance, tolerance (the meshing tolerance, absolute, 0.05 by default) and allowed are CadaclysmBlacksmith.clash()'s, and a row's a indexes parts, its b others (or parts again; then a < b). Rows come in pair order. others without other_poses or the other way round, a different number of poses in the two, a pose with the wrong number of frames, an empty set, fewer than two poses, an allowed pair that is not two indices or one out of range, a part that is not a closed solid, or a bad frame, tolerance, clearance, resolution or max_steps returns null, false or an empty value (the reason in Cadaclysm.last_error()); the kernel's own words are prefixed swept_clash:.
others and other_poses have no default: pass null for both for one set. allowed is a flat PackedInt32Array, as CadaclysmCollider.create's.
CadaclysmBlacksmith.thickness()
static func thickness(solids: Array, maximum: float, sharp_angle: float = 0.0, tolerance: float = 0.01) -> Variant
Every wall-thickness reading within maximum on solids, measured against each other, as CadaclysmThickness rows by body then vertex: a CadaclysmThicknessGauge built at tolerance (0.01 by default), asked CadaclysmThicknessGauge.thickness() once and freed. Build the gauge yourself to ask more than once. maximum not positive and finite, sharp_angle negative or not finite, or a tolerance not positive and finite returns null, false or an empty value (the reason in Cadaclysm.last_error()), with the gauge call's own prefix (thickness_gauge_new:, thickness_gauge_measure:).
CadaclysmBlacksmith.thickness(solids, maximum, sharp_angle, tolerance): sharp_angle defaults to 0 and tolerance to 0.01.
CadaclysmBlacksmith.mesh_thickness()
static func mesh_thickness(meshes: Array, maximum: float, sharp_angle: float = 0.0) -> Variant
The wall-thickness rule on plain meshes, measured against each other, as CadaclysmMeshThickness rows by mesh then vertex. Each of meshes is a pair: its points, (x, y, z) each, and its triangles, three indices into its own points each. From a vertex P the thickness is the distance to the nearest triangle that opposes one of P's own triangles (their normals more than 89 degrees apart) with P on or behind its plane — not a ray cast along the normal. A triangle with a vertex exactly at P is skipped; if one of those meets P's own at an interior angle under sharp_angle radians, P is a knife edge and reads 0. A vertex with no such triangle, or one further than maximum, gives no row: readings are dropped, not clamped. At the sharp rims of faceted holes it can read the wall far too thin (the distance to a neighbouring facet), an open finding. A mesh that is not such a pair, a position not finite, a triangle naming a point past its mesh, maximum not positive and finite, or sharp_angle negative or not finite returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Each mesh is [positions, triangles]: positions a PackedVector3Array or an array of points (an array of numbers keeps a double's precision), triangles a flat PackedInt32Array of three indices each or an array of triples; a mesh of another shape, a position of other than three numbers or a triangle of other than three indices (a negative one, or past a u32, included) is refused before the call (mesh_thickness: mesh M position P is not three numbers, mesh M triangle T is not three indices).
CadaclysmBlacksmith.closest_points()
static func closest_points(hay: Variant, needles: Variant, limit: float) -> Array[PackedInt64Array]
For each of needles, the indices of the hay points within limit of it, nearest first and equal distances by index — one CadaclysmRTree over hay answers every needle. A point within exactly limit counts. A limit negative or NaN, then the first hay point and the first needle with a NaN or infinite coordinate, by index, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmBlacksmith.k_neighbors()
static func k_neighbors(hay: Variant, needles: Variant, k: int) -> Array[PackedInt64Array]
For each of needles, the indices of the k nearest hay points, nearest first and equal distances by index (the smaller indices win a tie at the k-th place); every hay point when k is over their count. The first hay point and the first needle with a NaN or infinite coordinate, by index, or a k above 1,000,000, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
load Godot only
static func load(path: String) -> bool
Load the kernel library from a path before anything else asks for it. Optional, as the reader's.
Tolerances Godot only
static func default_tolerance() -> float
static func fillet_tolerance() -> float
The defaults the kernel's calls take: 0.05 for booleans, meshes and bounds, 1e-6 for fillet, chamfer and shell.
rgb Godot only
static func rgb(hex: String) -> Color
"#rgb", "#rrggbb" (the # optional) or a CSS colour name, matched ASCII case-insensitively, as a Color; black, with the reason in Cadaclysm.last_error(), for anything else.
write_svg and write_svg_text Godot only
static func write_svg(path: String, solids: Array) -> bool
static func write_svg_text(solids: Array) -> String
static func write_svg_text_with(solids: Array, options: Dictionary) -> String
static func write_svg_with(path: String, solids: Array, options: Dictionary) -> bool
The solids-only drawing CadaclysmBlacksmith.write_drawing_svg() supersedes, split as GDScript has no keyword arguments: write_svg_text(solids)/write_svg(path, solids) take every default, write_svg_text_with/write_svg_with take the keywords as a Dictionary, up left out always "z" — a solid carries no convention of its own to default it from. Kept so existing code keeps working.
write_drawing_svg_text and write_drawing_svg_with Godot only
static func write_drawing_svg_text(solids: Array, profiles: Array) -> String
static func write_drawing_svg_text_with(solids: Array, profiles: Array, options: Dictionary) -> String
static func write_drawing_svg_with(path: String, solids: Array, profiles: Array, options: Dictionary) -> bool
CadaclysmBlacksmith.write_drawing_svg() split as GDScript has no keyword arguments: write_drawing_svg_text(solids, profiles)/write_drawing_svg(path, solids, profiles) take every default, write_drawing_svg_text_with/write_drawing_svg_with take the keywords as a Dictionary, up left out always "z" as write_svg_text's.
CadaclysmProfile
class CadaclysmProfile extends RefCounted
A closed outline with holes, in its own x/y — what gets extruded, revolved, lofted or swept. Immutable: every method returns a new one.
Its loops must be simple: an outline that crosses or touches itself (a figure-eight, a vertex landing on another side), a hole that runs into the boundary, or two holes that overlap are refused by every call that builds a face or a closed solid, naming the loops — extrude: hole 0 crosses the boundary. The open calls (extrude_open, revolve_open, sweep_open, loft_open) build sheets, and take such a profile as it is.
CadaclysmProfile.rect()
static func rect(w: float, h: float) -> CadaclysmProfile
A w × h rectangle centred on the origin.
CadaclysmProfile.circle()
static func circle(r: float) -> CadaclysmProfile
A circle of radius r about the origin.
CadaclysmProfile.slot()
static func slot(centre: Variant, length: float, r: float) -> CadaclysmProfile
A slot (stadium) length long overall, with end radius r, centred on centre and running along x. length must exceed 2 * r.
CadaclysmProfile.polygon()
static func polygon(points: Variant) -> CadaclysmProfile
A closed polygon through the points, in order, its side back to the first point a segment of its own. At least three points.
CadaclysmProfile.regular_polygon()
static func regular_polygon(centre: Variant, radius: float, sides: int, angle: float = 0.0) -> CadaclysmProfile
A regular polygon of sides sides (at least 3) on the circle of radius about centre, its first corner at angle radians from the sketch's x axis (0 by default), the rest counter-clockwise. More than a million sides returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.circumscribed_polygon()
static func circumscribed_polygon(centre: Variant, radius: float, sides: int, angle: float = 0.0) -> CadaclysmProfile
A regular polygon of sides sides (at least 3) whose sides touch the circle of radius about centre — the polygon across flats, as a nut's hex is specified: its corners on the circle of radius / cos(pi / sides), each side's midpoint on the circle of radius. The first corner is at angle radians from the sketch's x axis (0 by default), the rest counter-clockwise, on the same rays as CadaclysmProfile.regular_polygon()'s corners for the same angle, so the inscribed and circumscribed polygons of one circle nest corner to corner. More than a million sides returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.star()
static func star(centre: Variant, outer: float, inner: float, points: int, angle: float = 0.0) -> CadaclysmProfile
A star of points tips (at least 3) on the circle of outer about centre, its inner corners on the circle of inner (positive, under outer), alternating: the first tip at angle radians from the sketch's x axis (0 by default), the rest counter-clockwise, each inner corner half a step on from the tip before it. 2 * points straight sides; an inner not under outer, or more than a million points, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.text()
static func text(text: String, size: float = 10.0, font: String = "", halign: String = "left", valign: String = "baseline", spacing: float = 1.0, direction: String = "ltr", font_bytes: PackedByteArray = PackedByteArray()) -> Array[CadaclysmProfile]
text set in a font, one profile per closed shape — a letter with its counters as holes (o one, 8 two; i is two profiles) — on the sketch plane, the baseline along x from the origin, each outline counter-clockwise and its holes clockwise, a curved side the font's own cubic Bezier kept exactly: an extruded O has curved walls, and writes to STEP as splines. size (10 by default) is roughly the height of a capital. font is a family, optionally with a style ("Liberation Sans:style=Bold"), a font file's path, or empty for the bundled Liberation Sans Regular — which also serves when the family is not found, so text never comes back empty; font_bytes a font file's bytes, used instead of font when given (a page or a phone fetches its own font). halign is left (default), center or right; valign baseline (default), bottom, center or top; spacing (1 by default) multiplies the gap between glyphs; direction ltr (default) or rtl. Glyphs are laid out one after another by their advance widths — no shaping, so Latin sets as expected and scripts that need ligatures or reordering do not. Empty text is an empty list. A size or spacing not positive and finite, an alignment or direction not one of those words, or font bytes that are not a font returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.spline()
static func spline(points: Variant, degree: int = 3, weights: PackedFloat64Array = PackedFloat64Array(), closed: bool = false) -> CadaclysmProfile
A spline of degree (3 by default) through the control polygon points, weights one per point or null. Open, it starts on the first point and ends on the last: an open chain, for CadaclysmSolid.extrude_open() or CadaclysmProfile.chain(). Closed, it is periodic — smooth through its own start, no corner there — and a closed profile. The degree is lowered to fit the points; a degree of zero, too few points (two open, three closed) or a weight not positive returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.path()
static func path(start: Variant) -> CadaclysmPath
Start drawing an outline segment by segment at start; see CadaclysmPath.
CadaclysmProfile.parabola()
static func parabola(vertex: Variant, axis: Variant, focal: float, from: float, to: float) -> CadaclysmPath
Start drawing on the arc of the parabola with vertex, axis direction axis and focal length focal, over the across-axis coordinates from..to: the path begins at the arc's first point and holds the arc as one conic segment — a reflector from rim to rim; parabola((0, 0), (0, 1), 20, -50, 50) is a dish 100 wide opening up. A zero axis, a focal length not positive and finite, or from not under to returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.chain()
static func chain(pieces: Array, tolerance: float = 1e-6) -> CadaclysmProfile
Open profiles — paths ended open — joined end to end into one: the forge's merge. They may come in any order and either way round: each next piece is the first of the rest with an end within tolerance (1e-6 by default) of either end of the chain so far, reversed where that makes it meet. Every segment is kept exactly — a line a line, an arc an arc, a spline the same spline. Closed where the chain's two ends meet, otherwise an open chain. A piece that is empty, has holes, is closed on its own or meets none of the others returns null, false or an empty value (the reason in Cadaclysm.last_error()) naming it by its index.
CadaclysmProfile.from_loops()
static func from_loops(loops: Array) -> CadaclysmProfile
Closed loops, in any order, as one profile: the loop enclosing the most area is the boundary and every other a hole in it, in the order given — a sketch's rectangle and the circles drawn inside it. Each loop is a closed profile with no holes of its own, wound either way; one that closes within rounding is closed exactly. A loop that is open, empty or encloses no area, loops that cross or touch, a hole outside the boundary, or one inside another hole (an island) returns null, false or an empty value (the reason in Cadaclysm.last_error()), naming the loops by their index.
CadaclysmProfile.close_loop()
func close_loop() -> CadaclysmProfile
This profile closed — the forge's sketch "close": where its last segment stops short of its start (a path ended open), a straight segment back to it; where it already comes back within 1e-9 of its extent, its last segment made to land on the start exactly. A closed profile comes back as it is, and holes are closed the same way.
CadaclysmProfile.polyline()
static func polyline(points: Variant, closed: bool = false) -> CadaclysmProfile
A polyline through points in order, a straight segment per side: an open chain, or with closed a side from the last point back to the first. A side of no length is kept, so a corner dragged onto its neighbour still draws. Fewer than two points (three closed) returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.arc()
static func arc(centre: Variant, r: float, a0: float, a1: float) -> CadaclysmProfile
The arc of radius r about centre from angle a0 counter-clockwise to a1 (radians from the sketch's x axis): one exact arc, open, the sweep taken the counter-clockwise way round. Equal angles are the whole circle, closed, starting at a0 — a circle anywhere on the sketch. A radius not positive and finite returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.arc_through()
static func arc_through(start: Variant, through: Variant, end: Variant) -> CadaclysmProfile
The arc from start through through to end: one exact arc leaving the start, open — the circle through the three points, swept the way round that passes through. Three points in a line returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.gear_involute()
static func gear_involute(module: float, teeth: int, pressure_angle: float = f64.NAN, shift: float = f64.NAN, addendum: float = f64.NAN, dedendum: float = f64.NAN, root_fillet: float = f64.NAN, backlash: float = f64.NAN, tolerance: float = f64.NAN) -> CadaclysmGearProfile
An involute spur gear of teeth teeth of module, tooth 0 centred on the sketch's x axis, as a CadaclysmGearProfile: the flanks NURBS within tolerance of the true involute, the tips, root fillets and root arcs exact — one closed outline that extrudes, cuts and exports as any other. null is the default: pressure_angle 20 degrees (radians), shift 0, addendum 1 and dedendum 1.25 (factors of the module), root_fillet 0.38 module, backlash 0 (taken off this gear's tooth), tolerance 1e-4 module. Undercut is flagged in the report, not drawn. Fewer than 4 teeth, a module not positive, a pressure angle outside (0, pi/4), a pointed tooth or a root fillet that does not fit returns null, false or an empty value (the reason in Cadaclysm.last_error()); CadaclysmBlacksmith.gear_centre_distance_involute() places its mate.
CadaclysmProfile.gear_wheel_cycloidal()
static func gear_wheel_cycloidal(module: float, teeth: int, pinion_leaves: int, thickness: float = f64.NAN, addendum: float = f64.NAN, dedendum: float = f64.NAN, root_fillet: float = f64.NAN, tolerance: float = f64.NAN) -> CadaclysmGearProfile
A cycloidal clock wheel of teeth teeth of module driving a pinion of pinion_leaves leaves, tooth 0 centred on the sketch's x axis, as a CadaclysmGearProfile: addendum flanks within tolerance of the true epicycloid rolled by a circle of half the pinion's pitch radius, radial dedendum flanks, fillets and root arcs exact. null is the default: thickness pi module / 2, addendum up to the flanks' crossing with the point rounded, dedendum 1.57 (a factor of the module), root_fillet 0.25 module, tolerance 1e-4 module. The centre distance to the pinion is the two reports' pitch radii added. A pinion of under 6 leaves, a wheel no larger than it, a size not positive or a fillet that does not fit returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.gear_pinion_cycloidal()
static func gear_pinion_cycloidal(module: float, leaves: int, wheel_teeth: int, thickness: float = f64.NAN, tip: String = "round", clearance: float = f64.NAN, root_fillet: float = f64.NAN, tolerance: float = f64.NAN) -> CadaclysmGearProfile
A cycloidal clock pinion of leaves leaves of module driven by a wheel of wheel_teeth teeth, leaf 0 centred on the sketch's x axis, as a CadaclysmGearProfile: radial flanks inside the pitch circle and a tip "round" (a semicircle of half the leaf thickness) or "ogive" (the epicycloid, truncated at 0.855 module). null is the default: thickness 1.05 module (6 to 10 leaves) or 1.25 module, clearance 0.4 module below the wheel's addendum, root_fillet 0.25 module, tolerance 1e-4 module. Under 6 leaves, a wheel no larger than the pinion, a size not positive, a negative clearance, a tip that is neither or a fillet that does not fit returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.ellipse()
static func ellipse(centre: Variant, rx: float, ry: float) -> CadaclysmProfile
The ellipse about centre with semi-axes rx along x and ry along y, closed: four exact quarter conics, counter-clockwise from the point rx along x. A semi-axis not positive and finite returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.from_beziers()
static func from_beziers(beziers: PackedFloat64Array, recognise: bool = true) -> CadaclysmProfile
Rational cubic Béziers end to end as one open profile — sixteen numbers each, x y z w per control point (the point, then its weight), the record CadaclysmProfile.beziers() hands back. With recognise (the default) a straight Bézier becomes an exact line and a circular one an exact arc, so a trim, an extrusion or a fillet meets lines and cylinders; without it every Bézier is kept as the exact cubic it is, and CadaclysmProfile.chain() or CadaclysmProfile.close_loop() hands the same Béziers back. No Béziers, a number not finite or a weight not positive returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.beziers()
func beziers(frame: PackedFloat64Array = PackedFloat64Array()) -> PackedFloat64Array
This profile as rational cubic Béziers, sixteen numbers each — x y z w per control point, the point and its weight: a line one straight Bézier, an arc exact conic pieces of a quarter turn or less, a free-form side its own decomposition; the outline from its start, then each hole's. On the sketch plane (z = 0), or with frame carried onto that frame's plane — what a page draws a curve with.
CadaclysmProfile.loops()
static func loops(pieces: Array, tolerance: float = 1e-6) -> Array
The closed loops among pieces, each read by its two ends, the way a CAD sketch finds them: ends meet within tolerance; a loop is a chain of pieces through corners where exactly two ends meet (a corner of three or more is ambiguous, and no loop runs through it); a piece whose own ends meet, a closed one included, is a loop of its own. Each loop is its pieces' indices in the order it runs, from its lowest; each piece is in at most one. A piece with holes or nothing drawn returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.chain_order()
static func chain_order(pieces: Array, tolerance: float = 1e-6) -> Array
The order CadaclysmProfile.chain() takes pieces in, from the chain's start to its end: per piece its index and whether it was turned round to meet — what reorders a sketch's own curve list to match the chained profile. Refused as CadaclysmProfile.chain() is.
CadaclysmProfile.from_pieces()
static func from_pieces(pieces: String, closed: bool = false, tolerance: float = 0.0) -> CadaclysmProfile
A profile from piece definitions in the curve.polycurve grammar — a line {kind, x0, y0, x1, y1}, an arc through xm, ym, a circle, an ellipse, a rect, a polygon, a polyline or a spline — each made exact, put in chain order and turned to run on, joined where ends meet within tolerance (none: the pieces' effective tolerance). Closed where the chain's ends meet, or with a closing side when closed asks. What CadaclysmProfile.pieces_json() writes reads back to the same profile. A piece it cannot read, or pieces that do not chain, returns null, false or an empty value (the reason in Cadaclysm.last_error()), naming the piece by index.
CadaclysmProfile.pieces_json()
func pieces_json() -> String
This profile's outline as piece definitions, one per segment from its start: a line {x0, y0, x1, y1}, an arc {x0, y0, xm, ym, x1, y1} through its middle (a whole circle as two halves), anything else a cubic spline piece per Bézier — what an app stores and edits, and what CadaclysmProfile.from_pieces() reads back. A profile with holes returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.fillet_corner()
static func fillet_corner(a: CadaclysmProfile, b: CadaclysmProfile, radius: float, tolerance: float = 0.0) -> String
A sketch fillet between two open profiles that meet at an end, within tolerance: both cut back to the tangent points, each still running the way it ran, and the arc from the first's side to the second's, all as pieces CadaclysmProfile.from_pieces() reads — {a, b, arc}. Profiles that do not meet at an end, run straight on or fold back, or a radius that does not fit, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.bounds()
func bounds() -> PackedFloat64Array
The exact box of this profile in its sketch — min x, min y, max x, max y — over the outline and the holes, from the curves' own extremes rather than their control points: an arc's bulge is in it, a spline's control polygon is not.
CadaclysmProfile.reversed()
func reversed() -> CadaclysmProfile
This profile walked the other way, as a new one: its end the new start, its segments in reverse order, each turned round; each hole turned round in place. Twice is the profile.
CadaclysmProfile.pieces()
func pieces(cutters: Array, tolerance: float = 1e-6) -> Array[CadaclysmProfile]
This curve cut where the cutters cross, touch or run along it — the sketch trim's pieces: in order along the curve from its start, each an open profile of portions of this one's own segments (a line's stretch a line, an arc's an arc, a spline's the same spline over part of its domain, nothing refitted). One piece, this curve, where nothing cuts it; a closed curve's piece round its start is one piece. Cuts closer than tolerance to each other fold onto one. A curve with no segments returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.trim()
func trim(cutters: Array, piece: int, tolerance: float = 1e-6) -> Array[CadaclysmProfile]
This curve with piece piece of CadaclysmProfile.pieces() taken away — the sketch trim, the forge's: what is left, as open profiles. One for a closed curve (its other pieces run together from where the removed one ended), the stretches before and after for an open one, none where the piece was the whole curve. A piece the curve does not have returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.with_hole()
func with_hole(hole: CadaclysmProfile) -> CadaclysmProfile
This outline with hole cut out of it.
CadaclysmProfile.hits()
func hits(other: CadaclysmProfile, tolerance: float = 1e-6) -> Array[CadaclysmHit]
Where this outline's curves cross, touch or run along other's, both read in one plane, as CadaclysmHit values ordered along this outline. Points closer than tolerance merge; two curves within tolerance of each other for longer than it are one run when they part only where one of them ends or the stretch is flat — one curve following the other, offset within tolerance or tilted by under about half of it, even where it leaves mid-both; a tangency or a shallow crossing is one point. A loop that stops short of its start is an open chain, its closing side not tested.
CadaclysmProfile.common()
func common(other: CadaclysmProfile, tolerance: float = 1e-6) -> Array[CadaclysmProfile]
The region this outline and other share, both read in one plane, as a list of zero or more profiles — each boundary counter-clockwise, each hole clockwise, arcs and splines kept exact. An arc kept from an input can still come out split at that input's own seam point (two circles' lens is four arcs, one pair per circle) — exact, not an approximation. Two loops of a result may touch at a point (two holes whose corners meet, one from each input): a right point set that the verbs needing simple loops — CadaclysmSolid.extrude(), a boolean taking it as an input — refuse. Both must be closed and simple; no shared area is an empty list. A tolerance not positive and finite, an outline open or crossing itself, a tolerance too fine for these outlines (following their arcs and splines to a tenth of it would take more than 8 million points, about 128 MB), and, as a defect rather than an outcome, a result that fails to close, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.translate()
func translate(dx: float, dy: float) -> CadaclysmProfile
This outline moved by (dx, dy).
CadaclysmProfile.rotate()
func rotate(centre: Variant, radians: float) -> CadaclysmProfile
This outline turned radians (counter-clockwise) about centre.
CadaclysmProfile.scale()
func scale(centre: Variant, sx: float, sy: float) -> CadaclysmProfile
This outline scaled by sx, sy about centre. An arc stays an arc where the two are equal in size, and becomes exact conics (rational quadratics) otherwise; a negative factor mirrors across that axis, and a zero one returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.mirror()
func mirror(point: Variant, direction: Variant) -> CadaclysmProfile
This outline reflected across the line through point along direction; each arc's sense turns. A zero direction returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.transform2d()
func transform2d(m: Variant) -> CadaclysmProfile
This outline under the 2D affine map m, six numbers row-major (2×3): x' = m0·x + m1·y + m2, y' = m3·x + m4·y + m5. Lines, Béziers, conics and NURBS map by their points, exactly; a singular map returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.coloured()
func coloured(colour: Variant) -> CadaclysmProfile
A new outline coloured (r, g, b), each 0..1, "#rgb", "#rrggbb" or a CSS colour name ("tomato", "RebeccaPurple"): how it is drawn. The verbs that make a profile from one carry it (translate, round, with_hole keeps the outer's, chain and from_loops the first's); a solid made from it takes nothing — colour a solid with CadaclysmSolid.coloured().
Takes a Color, colour text ("#rgb", "#rrggbb" or a CSS colour name) or three numbers; colour hands back a Color, or null.
CadaclysmProfile.round()
func round(radius: float, corners: PackedInt32Array = PackedInt32Array(), open: bool = false) -> CadaclysmProfile
This outline with its corners rounded by radius: at each corner both segments are cut back — lines, arcs and splines alike, each staying the curve it was — and an exact arc tangent to both goes between them. A corner the two run straight on through is no corner. With no corners every corner is rounded, the holes' too; a list picks corners of the outline — corner k is where segment k ends, and a picked corner that runs straight on is refused. open reads the profile as an open chain whose two ends stay square. A radius that does not fit returns null, false or an empty value (the reason in Cadaclysm.last_error()) naming the corner.
CadaclysmProfile.to_arcs()
func to_arcs(tolerance: float = 0.01) -> CadaclysmProfile
This profile with every free-form side (a Bezier, a conic, a NURBS) replaced by lines and arcs within tolerance of it — what a G-code writer can say. Lines and arcs pass through as they are, every loop closes on itself exactly, holes are converted the same way. tolerance (0.01 by default) not positive and finite, or a spline that does not evaluate, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.offset()
func offset(distance: float, tolerance: float = 0.01, corner: String = "round") -> Array[CadaclysmProfile]
This profile grown by distance (shrunk where it is negative), as zero or more profiles, all lines and arcs: outward corners rounded by |distance|, holes moving against the boundary (a hole shrinks as the profile grows). Free-form sides are fitted to tolerance first (CadaclysmProfile.to_arcs()). A shrink that eats the whole profile is an empty list. corner styles every corner where the moved sides part: round (the arc about the corner, the default), sharp (the sides extended along their tangents until they meet; chamfered past a miter of 100 times the distance), smooth (the parabola tangent to both sides, an exact conic) or chamfer (a line across). A distance not finite, a tolerance (0.01 by default) not positive and finite, a loop with no sides, loops that cross or touch, or another style, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.offset_open()
func offset_open(distance: float, tolerance: float = 0.01, corner: String = "round", end: String = "none") -> Array[CadaclysmProfile]
This profile read as an open chain (its implicit closing side and holes ignored), offset by distance. With no end style: the one-sided offset, open chains moved distance to the right of travel (negative, the left), the overlaps at inside corners trimmed. Ends flat or round: the closed outline both sides at |distance|, each end capped by a line across or a half circle. corner styles the joins as CadaclysmProfile.offset() does. A distance not finite (or 0 with ends), a chain with no sides, or another style, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.union()
func union(other: CadaclysmProfile, tolerance: float = 1e-6) -> Array[CadaclysmProfile]
The region this outline or other covers, both read in one plane, as zero or more profiles — each boundary counter-clockwise, each hole clockwise, arcs and splines kept exact. Both must be closed and simple; refused as CadaclysmProfile.common() is.
CadaclysmProfile.difference()
func difference(other: CadaclysmProfile, tolerance: float = 1e-6) -> Array[CadaclysmProfile]
The region of this outline that other does not cover, as zero or more profiles, exact as CadaclysmProfile.union(); refused as CadaclysmProfile.common() is.
CadaclysmProfile.regions()
static func regions(profiles: Array, tolerance: float = 1e-6) -> Array[CadaclysmProfile]
Every region the closed profiles split the plane into, each once, exact: two overlapping squares are three regions. Which inputs hold a region: those it CadaclysmProfile.relationship()s as inside or equal. A boolean's refusal returns null, false or an empty value (the reason in Cadaclysm.last_error()) naming the input.
CadaclysmProfile.contains()
func contains(point: Variant, tolerance: float = 1e-6) -> String
Where point lies against this closed outline: on within tolerance of any loop (holes included; the distance exact to lines, arcs and splines), else inside or outside by the even-odd rule. An open chain is read closed by its implicit side. A profile with no segments or a point not finite returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.relationship()
func relationship(other: CadaclysmProfile, tolerance: float = 1e-6) -> String
How this closed outline's region stands to other's: disjoint (no point in common), touching (the boundaries meet, the interiors do not overlap), overlapping (the interiors overlap and neither holds the other), a inside b (this one inside other), b inside a, or equal (one region, to the tolerance). An input open or crossing itself returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.deviation()
func deviation(other: CadaclysmProfile, tolerance: float = 1e-6) -> CadaclysmDeviation
The largest and smallest distance between this outline and other's (every loop), both ways round, with the two points of each: a CadaclysmDeviation. Every figure within tolerance of the true one. A profile with no segments or a spline that does not evaluate returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.reduce_segments()
func reduce_segments(tolerance: float = 0.01, open: bool = false) -> CadaclysmProfile
This outline with every run of consecutive straight segments simplified by Douglas–Peucker within tolerance: a vertex goes where the run stays within tolerance of it. Arcs, splines and the ends of every run are kept. open reads it as an open chain.
CadaclysmProfile.merge_colinear()
func merge_colinear(angle_tolerance: float = 1e-9, open: bool = false, include_seam: bool = true) -> CadaclysmProfile
This outline with neighbouring segments that are one curve made one: two lines turning less than angle_tolerance radians, two arcs on one circle turning one way (never a full circle). include_seam merges a closed loop's last and first segments too. An angle outside [0, pi) returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.break_at_kinks()
func break_at_kinks(angle: float, open: bool = false) -> Array[CadaclysmProfile]
The outer loop cut into open pieces wherever the direction of travel turns by more than angle radians at a joint. A closed loop with no kink comes back whole; with kinks, as open pieces starting at its first. An angle outside [0, pi] or no segments returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.is_convex()
func is_convex(strict: bool = false) -> bool
Whether this closed outline is convex: no holes, and its outer loop turns one way only (every joint, arc and spline) through one full turn. strict also refuses a joint between two lines that does not turn.
CadaclysmProfile.make_closed()
func make_closed(tolerance: float = 1e-6) -> CadaclysmProfile
This open chain closed by moving its end onto its start where the two are within tolerance: a line's end moves, an arc's centre moves onto the bisector of its new chord, a Bézier's end moves with its last inner control point, a spline's last control point moves. A wider gap, or a chain that closed would enclose nothing, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.with_seam()
func with_seam(point: Variant) -> CadaclysmProfile
This closed outline with its outer loop restarted at its point nearest point: the segment there split exactly and the loop rotated; a point at a joint rotates it without a split. Holes kept.
CadaclysmProfile.document_path
This profile as its exact segments, as a Document's profile.path node holds it: a record of its start, its segments (each a line, arc, bezier, conic or nurbs with its points, weights and knots, never flattened), its holes and its colour. What Document.add_profile puts in a document.
Not in this wrapper yet.
CadaclysmProfile.polylines
The outline, then each hole, as polylines at z = 0 within tolerance of its arcs and splines — what a viewer draws it with. A closed loop repeats its first point at the end; an open chain (a profile ended open) stays open. Views, like CadaclysmSolid.mesh() — copies in Node, Godot and Python.
Comes with the viewers follow-up.
CadaclysmProfile.show
Draw the outline and holes with the viewer in use, from the top by default. Keywords as CadaclysmSolid.show; edges= is ignored, the lines being the whole picture. With the GPU library (import cadaclysm.view.wgpu) the drawing replaces what one shared window shows and stays live — at the REPL, in IPython and in Jupyter by themselves, in a script until it exits; cadaclysm.view.View draws several items or several windows.
Comes with the viewers follow-up.
CadaclysmProfile.view
Orbit the outline with the viewer in use; returns the camera where it was left — a dict of eye, target, up, orthographic, azimuth and elevation — and pick, what was last clicked (item, node, face) or None. A fresh window, run until closed, with the GPU library.
Comes with the viewers follow-up.
CadaclysmProfile.svg()
func svg(path: String) -> bool
This profile's own loops as SVG: a line a line, an arc an arc, a spline the NURBS' own Béziers — exact curves, nothing flattened to the polyline CadaclysmProfile.polylines samples. The keywords are CadaclysmBlacksmith.write_drawing_svg()'s own, except view= defaults to top here rather than iso: a profile lies in z = 0, so its own plane is already the page and it reads flat and true. In the languages whose options are a struct (view already iso, not nullable), that default holds only when no options value is passed at all — pass one for anything else and its own view applies. With path, writes the file and returns null; without, returns the SVG text. returns null, false or an empty value (the reason in Cadaclysm.last_error()) on a refused option or a failed write.
CadaclysmProfile.length()
func length(accuracy: float = 0.0) -> CadaclysmLength
The perimeter of the outer loop — holes are not counted — as a CadaclysmLength: its exact curves measured to the relative accuracy, 0 asking for measure.default_accuracy (see CadaclysmBlacksmith.set_option()). An accuracy of NaN, infinite or 1 or more returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.area_properties()
func area_properties(accuracy: float = f64.NAN) -> CadaclysmAreaProperties
The region's area properties in the profile's own plane, as an CadaclysmAreaProperties: the outer loop less its holes, whatever their winding — Fusion's Profile.areaProperties, Rhino's AreaMassProperties of closed planar curves. Lines and arcs in closed form, polynomial splines exactly, rational ones to the relative accuracy (none or 0: 1e-9). An accuracy outside (0, 1), or a hole with holes of its own, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.point_at_length()
func point_at_length(s: float, accuracy: float = 0.0) -> CadaclysmAt
The point at arc length s along the outer loop, as an CadaclysmAt: s is absolute, measured from the loop's start, and lies in [0, length] (see CadaclysmProfile.length()) — past either end by no more than the length's own error is that end, further returns null, false or an empty value (the reason in Cadaclysm.last_error()). The sample names its side in segment, and parameter is that side's own: a line's 0 to 1, an arc's angle about its centre (a clockwise arc's angle decreasing along it), a spline's parameter. accuracy is relative, 0 or less asking for measure.default_accuracy; NaN, infinite or 1 or more returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProfile.divide_by_count()
func divide_by_count(n: int, accuracy: float = 0.0) -> Array[CadaclysmAt]
The outer loop in n pieces of equal arc length, as a list of CadaclysmAt: a profile is closed, so n samples from its start, never the start again. n is 1 to 1,000,000; accuracy as CadaclysmProfile.point_at_length().
CadaclysmProfile.divide_by_length()
func divide_by_length(step: float, accuracy: float = 0.0) -> Array[CadaclysmAt]
Samples of the outer loop every step of arc length from its start, as a list of CadaclysmAt: the last piece is whatever is left over, kept short, and the start is never repeated. step is positive and finite and may give at most 999,999 steps; accuracy as CadaclysmProfile.point_at_length().
svg_text and svg_with Godot only
func svg_text() -> String
func svg_text_with(options: Dictionary) -> String
func svg_with(path: String, options: Dictionary) -> bool
CadaclysmProfile.svg() split as CadaclysmBlacksmith's write_drawing_svg_text/write_drawing_svg_with are: svg_text()/svg(path) with every default, svg_text_with(options)/svg_with(path, options) with the keywords as a Dictionary — view left out of options is "top" here, not write_drawing_svg_text's own "iso".
CadaclysmPath
class CadaclysmPath extends RefCounted
An outline drawn a segment at a time — lines, arcs, Béziers, NURBS — then closed into a CadaclysmProfile. Ending it consumes the builder.
CadaclysmPath.line_to()
func line_to(x: float, y: float) -> CadaclysmPath
A straight segment to (x, y).
CadaclysmPath.arc_to()
func arc_to(x: float, y: float, centre: Variant, ccw: bool = true) -> CadaclysmPath
A circular arc to (x, y) about centre, counter-clockwise unless ccw is false.
CadaclysmPath.bezier_to()
func bezier_to(c1: Variant, c2: Variant, to: Variant) -> CadaclysmPath
A cubic Bézier through control points c1, c2 to to.
CadaclysmPath.conic_to()
func conic_to(x: float, y: float, control: Variant, weight: float) -> CadaclysmPath
A conic arc to (x, y) through the control point control with middle weight: under 1 an elliptical arc, 1 a parabola, over 1 a hyperbola — the rational quadratic Bézier, kept exact. A weight not positive and finite, an end on the current point, or a control point on the chord returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmPath.parabola_to()
func parabola_to(x: float, y: float, control: Variant) -> CadaclysmPath
A parabolic arc to (x, y) whose end tangents meet at control: CadaclysmPath.conic_to() with weight 1.
CadaclysmPath.hyperbola_to()
func hyperbola_to(x: float, y: float, control: Variant, weight: float) -> CadaclysmPath
A hyperbolic arc to (x, y) through control with middle weight over 1; a weight of 1 or under returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmPath.parabola_by_vertex()
func parabola_by_vertex(x: float, y: float, vertex: Variant) -> CadaclysmPath
The parabolic arc to (x, y) whose vertex is vertex: the axis and focal length are solved from the two ends. A vertex on the chord, or one no parabola through both ends has (the vertex must be the arc's extreme point), returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmPath.parabola_by_focus()
func parabola_by_focus(x: float, y: float, focus: Variant) -> CadaclysmPath
The parabolic arc to (x, y) whose focus is focus: of the two parabolas through the ends with that focus, the one whose vertex lies between the ends' projections, then the one whose arc cups the focus (the focus between the arc and its chord), then the more symmetric; with the focus beyond the chord that is the arch over the ends, not the shallow dish — draw that one with CadaclysmProfile.parabola(). A focus on the chord returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmPath.nurbs_to()
func nurbs_to(control: Variant, knots: Variant, degree: int, weights: PackedFloat64Array = PackedFloat64Array()) -> CadaclysmPath
A NURBS segment: control is every control point after the current one, the endpoint last; knots the full knot vector; weights one per control point including the current one, or null for a non-rational curve.
CadaclysmPath.end()
func end() -> CadaclysmProfile
Close the outline back to its start and return the CadaclysmProfile.
CadaclysmPath.end_open()
func end_open() -> CadaclysmProfile
The path as it stands, not closed: an open chain for CadaclysmSolid.extrude_open(), CadaclysmSolid.sweep_open() or CadaclysmSolid.loft_open().
begin Godot only
static func begin(start: Variant) -> CadaclysmPath
Python's Path(start), the same as CadaclysmProfile.path(). Each step returns the path itself, so steps chain; a step that fails returns null and spends the path.
CadaclysmSweepPath
class CadaclysmSweepPath extends RefCounted
The 3D path a profile is carried along by CadaclysmSolid.sweep(): lines and circular arcs. Sweeping only borrows it, so one path can be swept many times; close it when done.
CadaclysmSweepPath.at()
static func at(point: Variant) -> CadaclysmSweepPath
Start a path at a 3D point.
CadaclysmSweepPath.along()
static func along(curve: CadaclysmProfile, frame: Variant, tolerance: float = 0.05, open: bool = true) -> CadaclysmSweepPath
The path a 2D chain (usually from CadaclysmPath.end_open()) draws on frame: a line a straight piece, an arc a circular one, a Bézier or spline fitted with biarcs — arcs tangent to each other and to the curve — within tolerance, so the path is tangent throughout and the sweep exact along it. open false closes the path back to its start.
CadaclysmSweepPath.line_to()
func line_to(point: Variant) -> CadaclysmSweepPath
A straight piece to a 3D point.
CadaclysmSweepPath.arc()
func arc(centre: Variant, axis: Variant, angle: float) -> CadaclysmSweepPath
Turn angle radians (in (0, 2π]) about the axis through centre along axis.
Slant
A plane a CadaclysmSolid.extrude_between() starts or ends on, read as a height over the sketch plane at each point: at + grad · (x, y). Flat for an ordinary cap; sloped for a mitre.
No class: a slant is a number — a flat plane at that height — or a Dictionary {at, grad}, grad two numbers.
CadaclysmBlacksmith.slant_of_plane()
static func slant_of_plane(frame: Variant, point: Variant, normal: Variant) -> Dictionary
The plane through point square to normal, as heights over frame. A plane that contains the extrusion direction has no height and returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Returns the {at, grad} Dictionary; an empty one on failure.
CadaclysmFrame
class CadaclysmFrame extends RefCounted
A frame built for you instead of twelve numbers typed out: an origin and three unit axes, square to each other and right-handed (z = x × y). It goes wherever a frame does. Immutable. The constructor takes the origin and the three axes, normalises them, and returns null, false or an empty value (the reason in Cadaclysm.last_error()) when they are not square or not right-handed.
CadaclysmFrame.xy()
static func xy(origin: Vector3 = Vector3.ZERO) -> CadaclysmFrame
The world XY plane through origin: z up, as CadaclysmWorkplane.xy().
CadaclysmFrame.xz()
static func xz(origin: Vector3 = Vector3.ZERO) -> CadaclysmFrame
The world XZ plane through origin: x along X, y along Z, so z is -Y, as CadaclysmWorkplane.xz().
CadaclysmFrame.yz()
static func yz(origin: Vector3 = Vector3.ZERO) -> CadaclysmFrame
The world YZ plane through origin: x along Y, y along Z, so z is +X, as CadaclysmWorkplane.yz().
CadaclysmFrame.at()
static func at(origin: Variant, normal: Variant, x: Vector3 = Vector3.ZERO) -> CadaclysmFrame
The plane through origin square to normal, which becomes the frame's z (it need not be unit). Its x axis is x laid onto that plane; with none, world X laid onto it, or world Y when the normal is within about 25° of X — the axes CadaclysmSolid.face_frame() gives a face facing normal. So a normal along +Z, -Y or +X gives exactly CadaclysmFrame.xy(), CadaclysmFrame.xz() or CadaclysmFrame.yz(). A zero normal, or an x along the normal, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmFrame.of()
static func of(raw: Variant) -> CadaclysmFrame
Twelve numbers — what CadaclysmSolid.face_frame() and CadaclysmWorkplane.frame hand back — as a checked frame, to read its axes or move it.
CadaclysmFrame.midplane
The plane midway between the planes of frames a and b: for parallel planes the one halfway between, on a's axes; for planes that meet, the plane bisecting them through the line they meet on, its x along that line.
Not in the Godot extension.
CadaclysmFrame.through
The plane through the points p, q and r: its origin p, its x towards q, its z the normal the three turn about counter-clockwise. Three points on one line returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Not in the Godot extension.
CadaclysmFrame.origin
var origin: Vector3 # read-only
var x: Vector3 # read-only
var y: Vector3 # read-only
var z: Vector3 # read-only
The origin and the three axes, each three numbers.
CadaclysmFrame.translate()
func translate(dx: float, dy: float, dz: float) -> CadaclysmFrame
This frame moved by (dx, dy, dz) in world coordinates.
CadaclysmFrame.offset()
func offset(distance: float) -> CadaclysmFrame
This frame moved distance along its own z: Frame.xy().offset(5) is the XY plane at z = 5.
CadaclysmFrame.fit()
static func fit(points: Variant) -> Variant
The least-squares plane through points (three or more, not all on one line) as a frame, and the largest distance any point lies off it: (frame, deviation). Fewer points, or points on one line, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
A Dictionary {frame, deviation}, or null. points is a PackedVector3Array or an Array of points.
CadaclysmFrame.flip()
func flip() -> CadaclysmFrame
The same plane facing the other way: x and y swapped, z reversed.
CadaclysmFrame.rotate()
func rotate(radians: float, axis: Variant) -> CadaclysmFrame
This frame turned radians about axis through its origin, right-handed.
CadaclysmFrame.to_local()
func to_local(p: Variant) -> Vector3
The point p in this frame's coordinates.
A Vector3, so floats in a default build.
CadaclysmFrame.closest_point()
func closest_point(p: Variant) -> Vector3
The point p dropped onto the frame's plane along its z.
A Vector3, so floats in a default build.
CadaclysmFrame.distance_to()
func distance_to(p: Variant) -> float
How far p lies above the frame's plane, along its z: negative below.
create Godot only
static func create(origin: Variant, x: Variant, y: Variant, z: Variant) -> CadaclysmFrame
Python's Frame(origin, x, y, z): the frame with these axes, normalised, or null where they are not square or not right-handed. (new is GDScript's own, so the constructor is create.)
Transform3D Godot only
static func from_transform(transform: Transform3D) -> CadaclysmFrame
func to_transform() -> Transform3D
A frame from a Transform3D — its basis square, unscaled and right-handed, or null — and a frame as one: basis columns x, y, z and the origin. Any call taking a frame takes a Transform3D as well.
raw Godot only
var raw: PackedFloat64Array # read-only
The twelve doubles — origin, x, y, z — that origin, x, y and z hold as Vector3s of floats.
is_equal_approx Godot only
func is_equal_approx(other: CadaclysmFrame, tolerance: float = 1e-9) -> bool
Whether another frame's twelve numbers are each within tolerance of this one's.
CadaclysmTransform
class CadaclysmTransform extends RefCounted
An affine map of space: a 4×4 matrix, row-major, its bottom row 0 0 0 1 (a projective one returns null, false or an empty value (the reason in Cadaclysm.last_error())). Immutable, with nothing to free; it iterates as its 16 numbers. a @ b is a after b. The constructors and decompositions are the library's own, so every language computes them alike. A frame argument is a CadaclysmFrame or 12 numbers: one within 1e-6 of right-handed and orthonormal is squared up, any other returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmTransform.from_rows()
static func from_rows(rows: Variant) -> CadaclysmTransform
The map 16 numbers state, row-major, or four rows of four.
An Array or PackedFloat64Array of 16 numbers, or four rows of four. GDScript has no operators on a class: a.compose(b) is a after b.
CadaclysmTransform.identity()
static func identity() -> CadaclysmTransform
The map that moves nothing.
CadaclysmTransform.rotation()
static func rotation(point: Variant, direction: Variant, radians: float) -> CadaclysmTransform
A turn of radians about the line through point along direction, right-handed.
rotation(point, direction, radians); a point or direction is a Vector3 or three numbers (an Array keeps a double's precision).
CadaclysmTransform.mirror()
static func mirror(plane: Variant) -> CadaclysmTransform
The reflection across plane, its z the normal.
CadaclysmTransform.scale()
static func scale(centre: Variant, k: float) -> CadaclysmTransform
A uniform scale by k about centre.
CadaclysmTransform.scale_xyz()
static func scale_xyz(frame: Variant, sx: float, sy: float, sz: float) -> CadaclysmTransform
A scale by sx, sy, sz along frame's axes, about its origin.
CadaclysmTransform.shear()
static func shear(plane: Variant, direction: Variant, factor: float) -> CadaclysmTransform
Every point slid along direction by factor times its height above plane. direction is normalised, so factor alone sets the slide; one off the plane returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmTransform.plane_to_plane()
static func plane_to_plane(a: Variant, b: Variant) -> CadaclysmTransform
The rigid map sending frame a onto frame b.
CadaclysmTransform.change_basis()
static func change_basis(from: Variant, to: Variant) -> CadaclysmTransform
Coordinates in frame from_ to coordinates in frame to.
CadaclysmTransform.planar_projection()
static func planar_projection(plane: Variant) -> CadaclysmTransform
The orthogonal projection onto plane (singular by design).
CadaclysmTransform.project_along()
static func project_along(plane: Variant, direction: Variant) -> CadaclysmTransform
The parallel projection onto plane along direction; a direction in the plane returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmTransform.rows
var rows: PackedFloat64Array # read-only
The 16 numbers, row-major.
A read-only PackedFloat64Array property.
CadaclysmTransform.point()
func point(p: Variant) -> PackedFloat64Array
Where the map takes the point p.
Three doubles as a PackedFloat64Array, not a float Vector3.
CadaclysmTransform.inverse()
func inverse() -> CadaclysmTransform
The map undoing this one; a singular map returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmTransform.is_rigid()
func is_rigid(tolerance: float = bs.MAP_TOLERANCE) -> bool
Whether the linear part is orthogonal (AᵀA = I to tolerance, 1e-9 by default): a rotation or a mirror.
false for a refused tolerance too, the reason in Cadaclysm.last_error().
CadaclysmTransform.is_similarity()
func is_similarity(tolerance: float = bs.MAP_TOLERANCE) -> Variant
The scale k where the linear part is k times an orthogonal one (to tolerance, relative to k²); null otherwise.
null for a refused tolerance too, the reason in Cadaclysm.last_error().
CadaclysmTransform.decompose_rigid()
func decompose_rigid(tolerance: float = bs.MAP_TOLERANCE) -> Variant
(translation, orthogonal part) for a rigid map; null otherwise.
A Dictionary {translation, orthogonal} — a PackedFloat64Array and a CadaclysmTransform — or null.
CadaclysmTransform.decompose_similarity()
func decompose_similarity(tolerance: float = bs.MAP_TOLERANCE) -> Variant
(translation, orthogonal part, k) for a similarity; null otherwise.
A Dictionary {translation, orthogonal, k}, or null.
CadaclysmTransform.decompose_affine()
func decompose_affine() -> Variant
(translation, rotation, axes, stretch) with the linear part rotation · axes · diag(stretch) · axesᵀ: rotation carries the mirror, axes is a proper rotation whose columns are the stretch directions, the stretches come largest first. null for a singular map, or one stretched past 1e7:1.
A Dictionary {translation, rotation, axes, stretch} — rotation and axes CadaclysmTransforms, the others PackedFloat64Arrays — or null.
compose Godot only
func compose(other: CadaclysmTransform) -> CadaclysmTransform
Python's a @ b, as GDScript has no operators on a class: a.compose(b) is a after b, so a.compose(b).point(p) is a.point(b.point(p)). Not Godot's own Transform3D, which holds floats in a default build: these maps are doubles throughout.
CadaclysmQuaternion
class CadaclysmQuaternion extends RefCounted
A rotation as w + xi + yj + zk. Immutable; it iterates as w, x, y, z. q and -q are the same rotation; a non-unit one is normalised where it becomes a rotation, and a zero one returns null, false or an empty value (the reason in Cadaclysm.last_error()) there. a * b turns by b, then by a.
CadaclysmQuaternion.from_axis_angle()
static func from_axis_angle(direction: Variant, radians: float) -> CadaclysmQuaternion
The turn of radians about direction, right-handed.
CadaclysmQuaternion.from_transform()
static func from_transform(t: CadaclysmTransform) -> CadaclysmQuaternion
The rotation in t's linear part (its translation ignored); anything but a proper rotation returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmQuaternion.slerp()
static func slerp(a: CadaclysmQuaternion, b: CadaclysmQuaternion, s: float) -> CadaclysmQuaternion
From a (s = 0) to b (s = 1) along the shorter arc.
CadaclysmQuaternion.to_transform()
func to_transform(centre: PackedFloat64Array = PackedFloat64Array()) -> CadaclysmTransform
This rotation as a CadaclysmTransform fixing centre.
centre is three numbers (a PackedFloat64Array or an Array); empty, the default, is the origin.
CadaclysmQuaternion.w
var w: float # read-only
var x: float # read-only
var y: float # read-only
var z: float # read-only
The four numbers.
CadaclysmQuaternion.axis()
func axis() -> Variant
The turn's axis; null for the identity.
A PackedFloat64Array, or null.
CadaclysmQuaternion.normalize()
func normalize() -> CadaclysmQuaternion
This quaternion at length 1; a zero one returns null, false or an empty value (the reason in Cadaclysm.last_error()).
create and identity Godot only
static func create(w: float, x: float, y: float, z: float) -> CadaclysmQuaternion
static func identity() -> CadaclysmQuaternion
Python's Quaternion(w, x, y, z) — null for a component not finite — and the identity, 1 + 0i + 0j + 0k. (new is GDScript's own, so the constructor is create.) Not Godot's own Quaternion, which holds floats in a default build.
components Godot only
var components: PackedFloat64Array # read-only
The four numbers w, x, y, z as a PackedFloat64Array: what Python's iteration gives.
multiply Godot only
func multiply(other: CadaclysmQuaternion) -> CadaclysmQuaternion
Python's a * b: a.multiply(b) turns by b, then by a.
CadaclysmInterval
class CadaclysmInterval extends RefCounted
A parameter range t0..t1, in either order: length and swapped keep the order, the set operations (grown, union, intersect) answer increasing. Immutable and hashable; it iterates as (t0, t1), so two numbers go wherever an Interval does. The values' angle and height ranges and the surfaces' domains are intervals.
CadaclysmInterval.of()
static func of(value: Variant) -> CadaclysmInterval
An Interval, or two numbers, as an Interval; any other count returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmInterval.grown()
func grown(t: float) -> CadaclysmInterval
The increasing interval holding this one and t.
CadaclysmInterval.union()
func union(other: Variant) -> CadaclysmInterval
The increasing interval holding this one and o.
CadaclysmInterval.intersect()
func intersect(other: Variant) -> CadaclysmInterval
The increasing overlap with o; null where the two are apart. Two that touch give a singleton.
CadaclysmInterval.contains()
func contains(t: float) -> bool
Whether t lies in the closed range, in either order.
CadaclysmInterval.parameter_at()
func parameter_at(s: float) -> float
t0 + s (t1 - t0): the fraction s of the way from t0; outside 0..1 extrapolates.
CadaclysmInterval.normalized_parameter_at()
func normalized_parameter_at(t: float) -> Variant
The fraction of the way t lies from t0 toward t1; null for a singleton.
create, values and equals Godot only
static func create(t0: float, t1: float) -> CadaclysmInterval
var values: PackedFloat64Array # read-only
func equals(other: Variant) -> bool
Python's Interval(t0, t1) — null for an end not finite — the two numbers as a PackedFloat64Array (what Python's iteration gives), and Python's ==: whether another interval holds the same two numbers in the same order. (new is GDScript's own, so the constructor is create.) Wherever a value takes a range, two numbers in an Array do too.
Tolerances
What a solid declares about its own precision, as a named tuple: absolute, a length in the model's own units, and angular, in radians — each none where nothing declared it. What CadaclysmSolid.tolerances() returns.
A Dictionary: absolute and angular, NAN where nothing is declared (Godot has no null number).
CadaclysmCurveFoot
class CadaclysmCurveFoot extends RefCounted
The closest point of a curve value, as a named tuple: its parameter t, the point, and unique — false where several points lie equally near and point is a fixed pick among them (a point on a circle's axis, one equidistant from an arc's ends).
t, point, raw_point and unique Godot only
var t: float # read-only
var point: Vector3 # read-only
var raw_point: PackedFloat64Array # read-only
var unique: bool # read-only
The named tuple's fields as read-only properties: point a Vector3 of floats, raw_point the same three doubles as a PackedFloat64Array.
CadaclysmSurfaceFoot
class CadaclysmSurfaceFoot extends RefCounted
The closest point of a surface value, as a named tuple: its parameters u, v, the point, and unique — false where several points lie equally near and point is a fixed pick among them (a sphere's centre, a point on an axis).
u, v, point, raw_point and unique Godot only
var u: float # read-only
var v: float # read-only
var point: Vector3 # read-only
var raw_point: PackedFloat64Array # read-only
var unique: bool # read-only
The named tuple's fields as read-only properties: point a Vector3 of floats, raw_point the same three doubles as a PackedFloat64Array.
CadaclysmLine
class CadaclysmLine extends RefCounted
The segment from start to end, as a value: a piece of construction geometry to measure, to project onto and to map, without building a solid. Its parameter runs 0..1. Immutable, with nothing to free: equal by value, hashable, iterating as its numbers, the maths the library's own, so every language answers alike. A frame argument is a CadaclysmFrame or 12 numbers; one within 1e-6 of right-handed and orthonormal is squared up, any other returns null, false or an empty value (the reason in Cadaclysm.last_error()), as does a size that is not positive and finite.
Points cross as Vector3s, so floats in a default build: compare them to 1e-5, not 1e-9. A point argument is a Vector3 or three numbers (an Array keeps a double's precision), and the array values keeps the doubles; GDScript has no operators on a class, so a.equals(b) is Python's a == b. A refused call returns null (NAN for a number or a point, false for contains) with the reason in Cadaclysm.last_error(). bounds() is an AABB, domain() an Array of two CadaclysmIntervals and corners() a PackedVector3Array.
CadaclysmLine.point_at()
func point_at(t: float) -> Vector3
The point at t: the fraction t of the way from start to end (0..1 spans the segment).
CadaclysmLine.tangent_at()
func tangent_at(t: float) -> Vector3
The unit tangent at t, the way t grows.
CadaclysmLine.closest_point()
func closest_point(p: Variant) -> CadaclysmCurveFoot
The CadaclysmCurveFoot nearest p: its parameter t, the point and unique. Exact for every kind, in closed form rather than by iteration. unique is false where several points lie equally near and the answer is a fixed pick among them — a point on a circle's axis, one equidistant from an arc's two ends; true otherwise.
CadaclysmLine.distance_to()
func distance_to(p: Variant) -> float
How far p lies from the curve: the distance to its closest_point.
CadaclysmLine.to_nurbs()
func to_nurbs() -> CadaclysmNurbsCurve
The curve as its exact CadaclysmNurbsCurve (a conic as a rational quadratic).
CadaclysmLine.bounds()
func bounds() -> AABB
The exact world box, (min, max), from the closed form rather than from samples.
CadaclysmLine.transform()
func transform(t: Variant) -> CadaclysmLine
This value under t (a CadaclysmTransform, or 16 numbers), a value of the same type. A line takes any map that keeps its ends apart and an ellipse any that keeps it an ellipse; every other value only a similarity — turn a circle into an CadaclysmEllipse first for anything else. Any other map returns null, false or an empty value (the reason in Cadaclysm.last_error()).
create, from_values, values and equals Godot only
static func create(start: Variant, end: Variant) -> CadaclysmLine
static func from_values(values: Variant) -> CadaclysmLine
var values: PackedFloat64Array # read-only
func equals(other: Variant) -> bool
Python's Line(...), with the same arguments, and the value from its raw array of 6 numbers, checked by the library (null for another count, in the library's words); the canonical array as a PackedFloat64Array (what Python's iteration gives); and Python's ==: the same kind with the same array. (new is GDScript's own, so the constructor is create.)
CadaclysmCircle
class CadaclysmCircle extends RefCounted
The circle of radius about the frame's origin in its x-y plane, running counter-clockwise about its z from its x, as a value. CadaclysmCurve's value gives an edge's circle. Immutable, with nothing to free: equal by value, hashable, iterating as its numbers, the maths the library's own, so every language answers alike. A frame argument is a CadaclysmFrame or 12 numbers; one within 1e-6 of right-handed and orthonormal is squared up, any other returns null, false or an empty value (the reason in Cadaclysm.last_error()), as does a size that is not positive and finite.
Points cross as Vector3s, so floats in a default build: compare them to 1e-5, not 1e-9. A point argument is a Vector3 or three numbers (an Array keeps a double's precision), and the array values keeps the doubles; GDScript has no operators on a class, so a.equals(b) is Python's a == b. A refused call returns null (NAN for a number or a point, false for contains) with the reason in Cadaclysm.last_error(). bounds() is an AABB, domain() an Array of two CadaclysmIntervals and corners() a PackedVector3Array.
CadaclysmCircle.through()
static func through(a: Variant, b: Variant, c: Variant) -> CadaclysmCircle
The circle through the points a, b and c: its x toward a, turning a, b, c counter-clockwise. Three points on one line returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmCircle.point_at()
func point_at(t: float) -> Vector3
The point at t: t the angle in radians from the frame's x toward its y.
CadaclysmCircle.tangent_at()
func tangent_at(t: float) -> Vector3
The unit tangent at t, the way t grows.
CadaclysmCircle.closest_point()
func closest_point(p: Variant) -> CadaclysmCurveFoot
The CadaclysmCurveFoot nearest p: its parameter t, the point and unique. Exact for every kind, in closed form rather than by iteration. unique is false where several points lie equally near and the answer is a fixed pick among them — a point on a circle's axis, one equidistant from an arc's two ends; true otherwise.
CadaclysmCircle.distance_to()
func distance_to(p: Variant) -> float
How far p lies from the curve: the distance to its closest_point.
CadaclysmCircle.to_nurbs()
func to_nurbs() -> CadaclysmNurbsCurve
The curve as its exact CadaclysmNurbsCurve (a conic as a rational quadratic).
CadaclysmCircle.frame
var frame: CadaclysmFrame # read-only
The CadaclysmFrame the value is placed on.
CadaclysmCircle.bounds()
func bounds() -> AABB
The exact world box, (min, max), from the closed form rather than from samples.
CadaclysmCircle.transform()
func transform(t: Variant) -> CadaclysmCircle
This value under t (a CadaclysmTransform, or 16 numbers), a value of the same type. A line takes any map that keeps its ends apart and an ellipse any that keeps it an ellipse; every other value only a similarity — turn a circle into an CadaclysmEllipse first for anything else. Any other map returns null, false or an empty value (the reason in Cadaclysm.last_error()).
create, from_values, values and equals Godot only
static func create(frame: Variant, radius: float) -> CadaclysmCircle
static func from_values(values: Variant) -> CadaclysmCircle
var values: PackedFloat64Array # read-only
func equals(other: Variant) -> bool
Python's Circle(...), with the same arguments, and the value from its raw array of 13 numbers, checked by the library (null for another count, in the library's words); the canonical array as a PackedFloat64Array (what Python's iteration gives); and Python's ==: the same kind with the same array. (new is GDScript's own, so the constructor is create.)
CadaclysmArc
class CadaclysmArc extends RefCounted
The part of a circle over angle (an CadaclysmInterval or two numbers, increasing, by at most a full turn), as a value: the circle's frame and radius, its angles measured from the frame's x toward its y. CadaclysmCurve's value gives an edge's arc. Immutable, with nothing to free: equal by value, hashable, iterating as its numbers, the maths the library's own, so every language answers alike. A frame argument is a CadaclysmFrame or 12 numbers; one within 1e-6 of right-handed and orthonormal is squared up, any other returns null, false or an empty value (the reason in Cadaclysm.last_error()), as does a size that is not positive and finite.
Points cross as Vector3s, so floats in a default build: compare them to 1e-5, not 1e-9. A point argument is a Vector3 or three numbers (an Array keeps a double's precision), and the array values keeps the doubles; GDScript has no operators on a class, so a.equals(b) is Python's a == b. A refused call returns null (NAN for a number or a point, false for contains) with the reason in Cadaclysm.last_error(). bounds() is an AABB, domain() an Array of two CadaclysmIntervals and corners() a PackedVector3Array.
CadaclysmArc.through()
static func through(a: Variant, b: Variant, c: Variant) -> CadaclysmArc
The arc from a through b to c. Three points on one line returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmArc.from_start_tangent_end()
static func from_start_tangent_end(a: Variant, tangent: Variant, c: Variant) -> CadaclysmArc
The arc leaving a along tangent and ending at c. A zero tangent, or a c on the tangent's line, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmArc.start
var start: Vector3 # read-only
var end: Vector3 # read-only
var mid: Vector3 # read-only
The points at the start, the end and halfway along.
CadaclysmArc.point_at()
func point_at(t: float) -> Vector3
The point at t: t the angle in radians from the frame's x toward its y.
CadaclysmArc.tangent_at()
func tangent_at(t: float) -> Vector3
The unit tangent at t, the way t grows.
CadaclysmArc.closest_point()
func closest_point(p: Variant) -> CadaclysmCurveFoot
The CadaclysmCurveFoot nearest p: its parameter t, the point and unique. Exact for every kind, in closed form rather than by iteration. unique is false where several points lie equally near and the answer is a fixed pick among them — a point on a circle's axis, one equidistant from an arc's two ends; true otherwise.
CadaclysmArc.distance_to()
func distance_to(p: Variant) -> float
How far p lies from the curve: the distance to its closest_point.
CadaclysmArc.to_nurbs()
func to_nurbs() -> CadaclysmNurbsCurve
The curve as its exact CadaclysmNurbsCurve (a conic as a rational quadratic).
CadaclysmArc.bounds()
func bounds() -> AABB
The exact world box, (min, max), from the closed form rather than from samples.
CadaclysmArc.transform()
func transform(t: Variant) -> CadaclysmArc
This value under t (a CadaclysmTransform, or 16 numbers), a value of the same type. A line takes any map that keeps its ends apart and an ellipse any that keeps it an ellipse; every other value only a similarity — turn a circle into an CadaclysmEllipse first for anything else. Any other map returns null, false or an empty value (the reason in Cadaclysm.last_error()).
create, from_values, values and equals Godot only
static func create(frame: Variant, radius: float, angle: Variant) -> CadaclysmArc
static func from_values(values: Variant) -> CadaclysmArc
var values: PackedFloat64Array # read-only
func equals(other: Variant) -> bool
Python's Arc(...), with the same arguments, and the value from its raw array of 15 numbers, checked by the library (null for another count, in the library's words); the canonical array as a PackedFloat64Array (what Python's iteration gives); and Python's ==: the same kind with the same array. (new is GDScript's own, so the constructor is create.)
CadaclysmEllipse
class CadaclysmEllipse extends RefCounted
The ellipse of radius r1 along the frame's x and r2 along its y, as a value. Unlike a circle it takes any affine map that keeps it an ellipse. CadaclysmCurve's value gives an edge's whole ellipse (an elliptical arc's range stays on the CadaclysmCurve). Immutable, with nothing to free: equal by value, hashable, iterating as its numbers, the maths the library's own, so every language answers alike. A frame argument is a CadaclysmFrame or 12 numbers; one within 1e-6 of right-handed and orthonormal is squared up, any other returns null, false or an empty value (the reason in Cadaclysm.last_error()), as does a size that is not positive and finite.
Points cross as Vector3s, so floats in a default build: compare them to 1e-5, not 1e-9. A point argument is a Vector3 or three numbers (an Array keeps a double's precision), and the array values keeps the doubles; GDScript has no operators on a class, so a.equals(b) is Python's a == b. A refused call returns null (NAN for a number or a point, false for contains) with the reason in Cadaclysm.last_error(). bounds() is an AABB, domain() an Array of two CadaclysmIntervals and corners() a PackedVector3Array.
CadaclysmEllipse.from_circle()
static func from_circle(circle: CadaclysmCircle) -> CadaclysmEllipse
circle as an ellipse of two equal radii, to map by a non-uniform scale or a shear.
CadaclysmEllipse.r1
var r1: float # read-only
var r2: float # read-only
The radii along the frame's x and y.
CadaclysmEllipse.point_at()
func point_at(t: float) -> Vector3
The point at t: t the eccentric angle in radians, from the frame's x toward its y.
CadaclysmEllipse.tangent_at()
func tangent_at(t: float) -> Vector3
The unit tangent at t, the way t grows.
CadaclysmEllipse.closest_point()
func closest_point(p: Variant) -> CadaclysmCurveFoot
The CadaclysmCurveFoot nearest p: its parameter t, the point and unique. Exact for every kind, in closed form rather than by iteration. unique is false where several points lie equally near and the answer is a fixed pick among them — a point on a circle's axis, one equidistant from an arc's two ends; true otherwise.
CadaclysmEllipse.distance_to()
func distance_to(p: Variant) -> float
How far p lies from the curve: the distance to its closest_point.
CadaclysmEllipse.to_nurbs()
func to_nurbs() -> CadaclysmNurbsCurve
The curve as its exact CadaclysmNurbsCurve (a conic as a rational quadratic).
CadaclysmEllipse.frame
var frame: CadaclysmFrame # read-only
The CadaclysmFrame the value is placed on.
CadaclysmEllipse.bounds()
func bounds() -> AABB
The exact world box, (min, max), from the closed form rather than from samples.
CadaclysmEllipse.transform()
func transform(t: Variant) -> CadaclysmEllipse
This value under t (a CadaclysmTransform, or 16 numbers), a value of the same type. A line takes any map that keeps its ends apart and an ellipse any that keeps it an ellipse; every other value only a similarity — turn a circle into an CadaclysmEllipse first for anything else. Any other map returns null, false or an empty value (the reason in Cadaclysm.last_error()).
create, from_values, values and equals Godot only
static func create(frame: Variant, r1: float, r2: float) -> CadaclysmEllipse
static func from_values(values: Variant) -> CadaclysmEllipse
var values: PackedFloat64Array # read-only
func equals(other: Variant) -> bool
Python's Ellipse(...), with the same arguments, and the value from its raw array of 14 numbers, checked by the library (null for another count, in the library's words); the canonical array as a PackedFloat64Array (what Python's iteration gives); and Python's ==: the same kind with the same array. (new is GDScript's own, so the constructor is create.)
CadaclysmSphere
class CadaclysmSphere extends RefCounted
The sphere of radius about the frame's origin, as a value: u the longitude from the frame's x, v the latitude toward its z. Measure it, project onto it, test points against it, or make it a solid with to_solid. Immutable, with nothing to free: equal by value, hashable, iterating as its numbers, the maths the library's own, so every language answers alike. A frame argument is a CadaclysmFrame or 12 numbers; one within 1e-6 of right-handed and orthonormal is squared up, any other returns null, false or an empty value (the reason in Cadaclysm.last_error()), as does a size that is not positive and finite.
Points cross as Vector3s, so floats in a default build: compare them to 1e-5, not 1e-9. A point argument is a Vector3 or three numbers (an Array keeps a double's precision), and the array values keeps the doubles; GDScript has no operators on a class, so a.equals(b) is Python's a == b. A refused call returns null (NAN for a number or a point, false for contains) with the reason in Cadaclysm.last_error(). bounds() is an AABB, domain() an Array of two CadaclysmIntervals and corners() a PackedVector3Array.
CadaclysmSphere.point_at()
func point_at(u: float, v: float) -> Vector3
The point at (u, v), in the ranges domain gives.
CadaclysmSphere.normal_at()
func normal_at(u: float, v: float) -> Vector3
The outward unit normal at (u, v).
CadaclysmSphere.closest_point()
func closest_point(p: Variant) -> CadaclysmSurfaceFoot
The CadaclysmSurfaceFoot nearest p on the surface (a cylinder's and a cone's side, not their caps): its u, v, the point and unique. Exact for every kind, in closed form. unique is false where several points lie equally near and the answer is a fixed pick among them — a sphere's centre, a point on a cylinder's, cone's or torus's axis; true otherwise.
CadaclysmSphere.distance_to()
func distance_to(p: Variant) -> float
How far p lies from the surface: the distance to its closest_point.
CadaclysmSphere.domain()
func domain() -> Array[CadaclysmInterval]
The u and v ranges, as two CadaclysmIntervals.
CadaclysmSphere.to_nurbs_sheet()
func to_nurbs_sheet() -> CadaclysmSolid
The surface alone, as an open sheet on its exact NURBS form.
CadaclysmSphere.contains()
func contains(p: Variant, tolerance: float = bs.CONTAINS_TOLERANCE) -> bool
Whether p lies inside the closed shape or within tolerance of it (1e-9 by default).
CadaclysmSphere.area()
func area() -> float
The boundary's area, in closed form: a cylinder's and a cone's caps included.
CadaclysmSphere.to_solid()
func to_solid() -> CadaclysmSolid
The shape as a closed exact B-rep CadaclysmSolid, to join, cut and write.
CadaclysmSphere.frame
var frame: CadaclysmFrame # read-only
The CadaclysmFrame the value is placed on.
CadaclysmSphere.bounds()
func bounds() -> AABB
The exact world box, (min, max), from the closed form rather than from samples.
CadaclysmSphere.transform()
func transform(t: Variant) -> CadaclysmSphere
This value under t (a CadaclysmTransform, or 16 numbers), a value of the same type. A line takes any map that keeps its ends apart and an ellipse any that keeps it an ellipse; every other value only a similarity — turn a circle into an CadaclysmEllipse first for anything else. Any other map returns null, false or an empty value (the reason in Cadaclysm.last_error()).
create, from_values, values and equals Godot only
static func create(frame: Variant, radius: float) -> CadaclysmSphere
static func from_values(values: Variant) -> CadaclysmSphere
var values: PackedFloat64Array # read-only
func equals(other: Variant) -> bool
Python's Sphere(...), with the same arguments, and the value from its raw array of 13 numbers, checked by the library (null for another count, in the library's words); the canonical array as a PackedFloat64Array (what Python's iteration gives); and Python's ==: the same kind with the same array. (new is GDScript's own, so the constructor is create.)
CadaclysmCylinder
class CadaclysmCylinder extends RefCounted
The capped cylinder of radius about the frame's z over height (an increasing CadaclysmInterval along z, or two numbers), as a value: u the angle from the frame's x, v the height. Immutable, with nothing to free: equal by value, hashable, iterating as its numbers, the maths the library's own, so every language answers alike. A frame argument is a CadaclysmFrame or 12 numbers; one within 1e-6 of right-handed and orthonormal is squared up, any other returns null, false or an empty value (the reason in Cadaclysm.last_error()), as does a size that is not positive and finite.
Points cross as Vector3s, so floats in a default build: compare them to 1e-5, not 1e-9. A point argument is a Vector3 or three numbers (an Array keeps a double's precision), and the array values keeps the doubles; GDScript has no operators on a class, so a.equals(b) is Python's a == b. A refused call returns null (NAN for a number or a point, false for contains) with the reason in Cadaclysm.last_error(). bounds() is an AABB, domain() an Array of two CadaclysmIntervals and corners() a PackedVector3Array.
CadaclysmCylinder.height
var height: CadaclysmInterval # read-only
The range along the frame's z, an CadaclysmInterval.
CadaclysmCylinder.point_at()
func point_at(u: float, v: float) -> Vector3
The point at (u, v), in the ranges domain gives.
CadaclysmCylinder.normal_at()
func normal_at(u: float, v: float) -> Vector3
The outward unit normal at (u, v).
CadaclysmCylinder.closest_point()
func closest_point(p: Variant) -> CadaclysmSurfaceFoot
The CadaclysmSurfaceFoot nearest p on the surface (a cylinder's and a cone's side, not their caps): its u, v, the point and unique. Exact for every kind, in closed form. unique is false where several points lie equally near and the answer is a fixed pick among them — a sphere's centre, a point on a cylinder's, cone's or torus's axis; true otherwise.
CadaclysmCylinder.distance_to()
func distance_to(p: Variant) -> float
How far p lies from the surface: the distance to its closest_point.
CadaclysmCylinder.domain()
func domain() -> Array[CadaclysmInterval]
The u and v ranges, as two CadaclysmIntervals.
CadaclysmCylinder.to_nurbs_sheet()
func to_nurbs_sheet() -> CadaclysmSolid
The surface alone, as an open sheet on its exact NURBS form.
CadaclysmCylinder.contains()
func contains(p: Variant, tolerance: float = bs.CONTAINS_TOLERANCE) -> bool
Whether p lies inside the closed shape or within tolerance of it (1e-9 by default).
CadaclysmCylinder.area()
func area() -> float
The boundary's area, in closed form: a cylinder's and a cone's caps included.
CadaclysmCylinder.to_solid()
func to_solid() -> CadaclysmSolid
The shape as a closed exact B-rep CadaclysmSolid, to join, cut and write.
CadaclysmCylinder.frame
var frame: CadaclysmFrame # read-only
The CadaclysmFrame the value is placed on.
CadaclysmCylinder.bounds()
func bounds() -> AABB
The exact world box, (min, max), from the closed form rather than from samples.
CadaclysmCylinder.transform()
func transform(t: Variant) -> CadaclysmCylinder
This value under t (a CadaclysmTransform, or 16 numbers), a value of the same type. A line takes any map that keeps its ends apart and an ellipse any that keeps it an ellipse; every other value only a similarity — turn a circle into an CadaclysmEllipse first for anything else. Any other map returns null, false or an empty value (the reason in Cadaclysm.last_error()).
create, from_values, values and equals Godot only
static func create(frame: Variant, radius: float, height: Variant) -> CadaclysmCylinder
static func from_values(values: Variant) -> CadaclysmCylinder
var values: PackedFloat64Array # read-only
func equals(other: Variant) -> bool
Python's Cylinder(...), with the same arguments, and the value from its raw array of 15 numbers, checked by the library (null for another count, in the library's words); the canonical array as a PackedFloat64Array (what Python's iteration gives); and Python's ==: the same kind with the same array. (new is GDScript's own, so the constructor is create.)
CadaclysmCone
class CadaclysmCone extends RefCounted
The capped cone of base radius on the frame's x-y plane, its apex height up its z, as a value: u the angle from the frame's x, v the height. Immutable, with nothing to free: equal by value, hashable, iterating as its numbers, the maths the library's own, so every language answers alike. A frame argument is a CadaclysmFrame or 12 numbers; one within 1e-6 of right-handed and orthonormal is squared up, any other returns null, false or an empty value (the reason in Cadaclysm.last_error()), as does a size that is not positive and finite.
Points cross as Vector3s, so floats in a default build: compare them to 1e-5, not 1e-9. A point argument is a Vector3 or three numbers (an Array keeps a double's precision), and the array values keeps the doubles; GDScript has no operators on a class, so a.equals(b) is Python's a == b. A refused call returns null (NAN for a number or a point, false for contains) with the reason in Cadaclysm.last_error(). bounds() is an AABB, domain() an Array of two CadaclysmIntervals and corners() a PackedVector3Array.
CadaclysmCone.point_at()
func point_at(u: float, v: float) -> Vector3
The point at (u, v), in the ranges domain gives.
CadaclysmCone.normal_at()
func normal_at(u: float, v: float) -> Vector3
The outward unit normal at (u, v).
CadaclysmCone.closest_point()
func closest_point(p: Variant) -> CadaclysmSurfaceFoot
The CadaclysmSurfaceFoot nearest p on the surface (a cylinder's and a cone's side, not their caps): its u, v, the point and unique. Exact for every kind, in closed form. unique is false where several points lie equally near and the answer is a fixed pick among them — a sphere's centre, a point on a cylinder's, cone's or torus's axis; true otherwise.
CadaclysmCone.distance_to()
func distance_to(p: Variant) -> float
How far p lies from the surface: the distance to its closest_point.
CadaclysmCone.domain()
func domain() -> Array[CadaclysmInterval]
The u and v ranges, as two CadaclysmIntervals.
CadaclysmCone.to_nurbs_sheet()
func to_nurbs_sheet() -> CadaclysmSolid
The surface alone, as an open sheet on its exact NURBS form.
CadaclysmCone.contains()
func contains(p: Variant, tolerance: float = bs.CONTAINS_TOLERANCE) -> bool
Whether p lies inside the closed shape or within tolerance of it (1e-9 by default).
CadaclysmCone.area()
func area() -> float
The boundary's area, in closed form: a cylinder's and a cone's caps included.
CadaclysmCone.to_solid()
func to_solid() -> CadaclysmSolid
The shape as a closed exact B-rep CadaclysmSolid, to join, cut and write.
CadaclysmCone.frame
var frame: CadaclysmFrame # read-only
The CadaclysmFrame the value is placed on.
CadaclysmCone.bounds()
func bounds() -> AABB
The exact world box, (min, max), from the closed form rather than from samples.
CadaclysmCone.transform()
func transform(t: Variant) -> CadaclysmCone
This value under t (a CadaclysmTransform, or 16 numbers), a value of the same type. A line takes any map that keeps its ends apart and an ellipse any that keeps it an ellipse; every other value only a similarity — turn a circle into an CadaclysmEllipse first for anything else. Any other map returns null, false or an empty value (the reason in Cadaclysm.last_error()).
create, from_values, values and equals Godot only
static func create(frame: Variant, radius: float, height: float) -> CadaclysmCone
static func from_values(values: Variant) -> CadaclysmCone
var values: PackedFloat64Array # read-only
func equals(other: Variant) -> bool
Python's Cone(...), with the same arguments, and the value from its raw array of 14 numbers, checked by the library (null for another count, in the library's words); the canonical array as a PackedFloat64Array (what Python's iteration gives); and Python's ==: the same kind with the same array. (new is GDScript's own, so the constructor is create.)
CadaclysmTorus
class CadaclysmTorus extends RefCounted
The torus of major radius about the frame's z and minor radius about that circle, as a value: u the angle about the z from the frame's x, v the angle about the tube. Immutable, with nothing to free: equal by value, hashable, iterating as its numbers, the maths the library's own, so every language answers alike. A frame argument is a CadaclysmFrame or 12 numbers; one within 1e-6 of right-handed and orthonormal is squared up, any other returns null, false or an empty value (the reason in Cadaclysm.last_error()), as does a size that is not positive and finite.
Points cross as Vector3s, so floats in a default build: compare them to 1e-5, not 1e-9. A point argument is a Vector3 or three numbers (an Array keeps a double's precision), and the array values keeps the doubles; GDScript has no operators on a class, so a.equals(b) is Python's a == b. A refused call returns null (NAN for a number or a point, false for contains) with the reason in Cadaclysm.last_error(). bounds() is an AABB, domain() an Array of two CadaclysmIntervals and corners() a PackedVector3Array.
CadaclysmTorus.major
var major: float # read-only
var minor: float # read-only
The radius of the tube's centre circle, and the tube's own.
CadaclysmTorus.point_at()
func point_at(u: float, v: float) -> Vector3
The point at (u, v), in the ranges domain gives.
CadaclysmTorus.normal_at()
func normal_at(u: float, v: float) -> Vector3
The outward unit normal at (u, v).
CadaclysmTorus.closest_point()
func closest_point(p: Variant) -> CadaclysmSurfaceFoot
The CadaclysmSurfaceFoot nearest p on the surface (a cylinder's and a cone's side, not their caps): its u, v, the point and unique. Exact for every kind, in closed form. unique is false where several points lie equally near and the answer is a fixed pick among them — a sphere's centre, a point on a cylinder's, cone's or torus's axis; true otherwise.
CadaclysmTorus.distance_to()
func distance_to(p: Variant) -> float
How far p lies from the surface: the distance to its closest_point.
CadaclysmTorus.domain()
func domain() -> Array[CadaclysmInterval]
The u and v ranges, as two CadaclysmIntervals.
CadaclysmTorus.to_nurbs_sheet()
func to_nurbs_sheet() -> CadaclysmSolid
The surface alone, as an open sheet on its exact NURBS form.
CadaclysmTorus.contains()
func contains(p: Variant, tolerance: float = bs.CONTAINS_TOLERANCE) -> bool
Whether p lies inside the closed shape or within tolerance of it (1e-9 by default).
CadaclysmTorus.area()
func area() -> float
The boundary's area, in closed form: a cylinder's and a cone's caps included.
CadaclysmTorus.to_solid()
func to_solid() -> CadaclysmSolid
The shape as a closed exact B-rep CadaclysmSolid, to join, cut and write.
CadaclysmTorus.frame
var frame: CadaclysmFrame # read-only
The CadaclysmFrame the value is placed on.
CadaclysmTorus.bounds()
func bounds() -> AABB
The exact world box, (min, max), from the closed form rather than from samples.
CadaclysmTorus.transform()
func transform(t: Variant) -> CadaclysmTorus
This value under t (a CadaclysmTransform, or 16 numbers), a value of the same type. A line takes any map that keeps its ends apart and an ellipse any that keeps it an ellipse; every other value only a similarity — turn a circle into an CadaclysmEllipse first for anything else. Any other map returns null, false or an empty value (the reason in Cadaclysm.last_error()).
create, from_values, values and equals Godot only
static func create(frame: Variant, major: float, minor: float) -> CadaclysmTorus
static func from_values(values: Variant) -> CadaclysmTorus
var values: PackedFloat64Array # read-only
func equals(other: Variant) -> bool
Python's Torus(...), with the same arguments, and the value from its raw array of 14 numbers, checked by the library (null for another count, in the library's words); the canonical array as a PackedFloat64Array (what Python's iteration gives); and Python's ==: the same kind with the same array. (new is GDScript's own, so the constructor is create.)
CadaclysmCuboid
class CadaclysmCuboid extends RefCounted
The box over x, y, z (increasing CadaclysmIntervals, or pairs) along its frame's axes, as a value: an oriented bounding box, a region to test points against, a block to make a solid of. Immutable, with nothing to free: equal by value, hashable, iterating as its numbers, the maths the library's own, so every language answers alike. A frame argument is a CadaclysmFrame or 12 numbers; one within 1e-6 of right-handed and orthonormal is squared up, any other returns null, false or an empty value (the reason in Cadaclysm.last_error()), as does a size that is not positive and finite.
Points cross as Vector3s, so floats in a default build: compare them to 1e-5, not 1e-9. A point argument is a Vector3 or three numbers (an Array keeps a double's precision), and the array values keeps the doubles; GDScript has no operators on a class, so a.equals(b) is Python's a == b. A refused call returns null (NAN for a number or a point, false for contains) with the reason in Cadaclysm.last_error(). bounds() is an AABB, domain() an Array of two CadaclysmIntervals and corners() a PackedVector3Array.
CadaclysmCuboid.from_bounds()
static func from_bounds(min: Variant, max: Variant) -> CadaclysmCuboid
The world-aligned box from min to max; an empty or flat one returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmCuboid.around()
static func around(frame: Variant, points: Variant) -> CadaclysmCuboid
The tightest box holding points, aligned to frame. No points, or points flat along one of the frame's axes (a sheet, not a box), returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmCuboid.x
var x: CadaclysmInterval # read-only
var y: CadaclysmInterval # read-only
var z: CadaclysmInterval # read-only
The three ranges along the frame's axes, as CadaclysmIntervals.
CadaclysmCuboid.corners()
func corners() -> PackedVector3Array
The eight corners: the z0 face counter-clockwise about the frame's z from (x0, y0), then the z1 face in the same order.
CadaclysmCuboid.point_at()
func point_at(sx: float, sy: float, sz: float) -> Vector3
The point the fractions sx, sy, sz of the way along each range.
CadaclysmCuboid.closest_point()
func closest_point(p: Variant) -> Vector3
The closest point of the solid box to p: p itself where it lies inside.
CadaclysmCuboid.contains()
func contains(p: Variant, tolerance: float = bs.CONTAINS_TOLERANCE) -> bool
Whether p lies inside the closed shape or within tolerance of it (1e-9 by default).
CadaclysmCuboid.area()
func area() -> float
The boundary's area, in closed form: a cylinder's and a cone's caps included.
CadaclysmCuboid.to_solid()
func to_solid() -> CadaclysmSolid
The shape as a closed exact B-rep CadaclysmSolid, to join, cut and write.
CadaclysmCuboid.frame
var frame: CadaclysmFrame # read-only
The CadaclysmFrame the value is placed on.
CadaclysmCuboid.bounds()
func bounds() -> AABB
The exact world box, (min, max), from the closed form rather than from samples.
CadaclysmCuboid.transform()
func transform(t: Variant) -> CadaclysmCuboid
This value under t (a CadaclysmTransform, or 16 numbers), a value of the same type. A line takes any map that keeps its ends apart and an ellipse any that keeps it an ellipse; every other value only a similarity — turn a circle into an CadaclysmEllipse first for anything else. Any other map returns null, false or an empty value (the reason in Cadaclysm.last_error()).
create, from_values, values and equals Godot only
static func create(frame: Variant, x: Variant, y: Variant, z: Variant) -> CadaclysmCuboid
static func from_values(values: Variant) -> CadaclysmCuboid
var values: PackedFloat64Array # read-only
func equals(other: Variant) -> bool
Python's Cuboid(...), with the same arguments, and the value from its raw array of 18 numbers, checked by the library (null for another count, in the library's words); the canonical array as a PackedFloat64Array (what Python's iteration gives); and Python's ==: the same kind with the same array. (new is GDScript's own, so the constructor is create.)
CadaclysmRectangle
class CadaclysmRectangle extends RefCounted
The rectangle over x and y (increasing CadaclysmIntervals, or pairs) in its frame's x-y plane, as a value — Rhino's Rectangle3d. As a curve it is its boundary: t runs 0..4, one unit a side, from corner (x0, y0) counter-clockwise about the frame's z. Immutable, with nothing to free: equal by value, hashable, iterating as its numbers, the maths the library's own, so every language answers alike. A frame argument is a CadaclysmFrame or 12 numbers; one within 1e-6 of right-handed and orthonormal is squared up, any other returns null, false or an empty value (the reason in Cadaclysm.last_error()), as does a size that is not positive and finite.
Points cross as Vector3s, so floats in a default build: compare them to 1e-5, not 1e-9. A point argument is a Vector3 or three numbers (an Array keeps a double's precision), and the array values keeps the doubles; GDScript has no operators on a class, so a.equals(b) is Python's a == b. A refused call returns null (NAN for a number or a point, false for contains) with the reason in Cadaclysm.last_error(). bounds() is an AABB, domain() an Array of two CadaclysmIntervals and corners() a PackedVector3Array.
CadaclysmRectangle.x
var x: CadaclysmInterval # read-only
var y: CadaclysmInterval # read-only
The two ranges along the frame's x and y, as CadaclysmIntervals.
CadaclysmRectangle.frame
var frame: CadaclysmFrame # read-only
The CadaclysmFrame the rectangle lies on.
CadaclysmRectangle.corners()
func corners() -> PackedVector3Array
The four corners in Rhino's Corner(i) order: (x0, y0), (x1, y0), (x1, y1), (x0, y1).
CadaclysmRectangle.point_at()
func point_at(t: float) -> Vector3
The boundary's point at t: side k for t in k..k+1. A t outside 0..4 is clamped, as Rhino's PointAt does, not wrapped.
CadaclysmRectangle.tangent_at()
func tangent_at(t: float) -> Vector3
The unit direction of t's side: the frame's x, y, -x, -y in turn.
CadaclysmRectangle.closest_point()
func closest_point(p: Variant) -> CadaclysmCurveFoot
The CadaclysmCurveFoot on the boundary nearest p (projected onto the plane first). unique is false where two sides lie equally near — the centre, any point on the medial axis — and the answer is a fixed pick among them.
CadaclysmRectangle.distance_to()
func distance_to(p: Variant) -> float
How far p lies from the boundary.
CadaclysmRectangle.closest_point_in()
func closest_point_in(p: Variant, include_interior: bool = true) -> Vector3
Rhino's ClosestPoint(p, includeInterior): p projected onto the plane and clamped into the filled rectangle when include_interior (the default), else the boundary's closest point.
CadaclysmRectangle.contains()
func contains(p: Variant, tolerance: float = f64.NAN) -> String
Where p, projected onto the plane, lies: "inside", "outside", or "on" within tolerance of the boundary (Rhino's Contains). tolerance None (or NaN) is unset — the rectangle's own effective tolerance, tolerance.relative times its diagonal; 0 is exact, so only a point exactly on the boundary is on it. A negative or infinite one returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmRectangle.to_sheet()
func to_sheet() -> CadaclysmSolid
The filled rectangle as a one-face planar sheet CadaclysmSolid, facing the frame's z.
CadaclysmRectangle.to_nurbs()
func to_nurbs() -> CadaclysmNurbsCurve
The boundary as its exact closed degree-1 CadaclysmNurbsCurve, a knot at each corner, so its parameter is t.
CadaclysmRectangle.transform()
func transform(t: Variant) -> CadaclysmRectangle
This rectangle under t (a CadaclysmTransform, or 16 numbers): any map that keeps its sides square — a similarity, a mirror, a stretch along its own axes. A shear in its plane, or a map that flattens it, returns null, false or an empty value (the reason in Cadaclysm.last_error()) (Rhino's Transform answers a rectangle that is not the image).
create, from_values, values and equals Godot only
static func create(frame: Variant, x: Variant, y: Variant) -> CadaclysmRectangle
static func from_values(values: Variant) -> CadaclysmRectangle
var values: PackedFloat64Array # read-only
func equals(other: Variant) -> bool
Python's Rectangle(...), with the same arguments, and the value from its raw array of 16 numbers, checked by the library (null for another count, in the library's words); the canonical array as a PackedFloat64Array (what Python's iteration gives); and Python's ==: the same kind with the same array. (new is GDScript's own, so the constructor is create.)
CadaclysmTriangle
class CadaclysmTriangle extends RefCounted
The triangle a, b, c, as a value — Rhino's Triangle3d. Collinear or coincident points (an area at most 1e-12 of the longest side squared) returns null, false or an empty value (the reason in Cadaclysm.last_error()). Immutable, with nothing to free: equal by value, hashable, iterating as its numbers, the maths the library's own, so every language answers alike. A frame argument is a CadaclysmFrame or 12 numbers; one within 1e-6 of right-handed and orthonormal is squared up, any other returns null, false or an empty value (the reason in Cadaclysm.last_error()), as does a size that is not positive and finite.
Points cross as Vector3s, so floats in a default build: compare them to 1e-5, not 1e-9. A point argument is a Vector3 or three numbers (an Array keeps a double's precision), and the array values keeps the doubles; GDScript has no operators on a class, so a.equals(b) is Python's a == b. A refused call returns null (NAN for a number or a point, false for contains) with the reason in Cadaclysm.last_error(). bounds() is an AABB, domain() an Array of two CadaclysmIntervals and corners() a PackedVector3Array.
CadaclysmTriangle.a
var a: Vector3 # read-only
var b: Vector3 # read-only
var c: Vector3 # read-only
The three vertices.
CadaclysmTriangle.centroid()
func centroid() -> Vector3
The area centroid, the vertices' mean (Rhino's AreaCenter).
CadaclysmTriangle.circumcircle()
func circumcircle() -> CadaclysmCircle
The CadaclysmCircle through a, b and c: its x toward a, turning them counter-clockwise.
CadaclysmTriangle.point_at()
func point_at(wa: float, wb: float, wc: float) -> Vector3
The point of barycentric weights wa, wb, wc, used as given (they need not sum to 1).
CadaclysmTriangle.barycentric()
func barycentric(p: Variant) -> PackedFloat64Array
The weights (wa, wb, wc), summing to 1, of p projected onto the triangle's plane.
CadaclysmTriangle.closest_point()
func closest_point(p: Variant) -> Vector3
The closest point of the filled triangle to p, exact (by the vertex, edge and face regions, no iteration).
CadaclysmTriangle.distance_to()
func distance_to(p: Variant) -> float
How far p lies from the filled triangle.
CadaclysmTriangle.edge()
func edge(i: int) -> CadaclysmLine
Edge i as a CadaclysmLine: 0 a to b, 1 b to c, 2 c to a. Any other i returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmTriangle.to_sheet()
func to_sheet() -> CadaclysmSolid
The filled triangle as a one-face planar sheet CadaclysmSolid, its normal turning a, b, c counter-clockwise.
CadaclysmTriangle.transform()
func transform(t: Variant) -> CadaclysmTriangle
This triangle under t (a CadaclysmTransform, or 16 numbers): any affine map, the vertices to their images. One that flattens it returns null, false or an empty value (the reason in Cadaclysm.last_error()).
create, from_values, values and equals Godot only
static func create(a: Variant, b: Variant, c: Variant) -> CadaclysmTriangle
static func from_values(values: Variant) -> CadaclysmTriangle
var values: PackedFloat64Array # read-only
func equals(other: Variant) -> bool
Python's Triangle(...), with the same arguments, and the value from its raw array of 9 numbers, checked by the library (null for another count, in the library's words); the canonical array as a PackedFloat64Array (what Python's iteration gives); and Python's ==: the same kind with the same array. (new is GDScript's own, so the constructor is create.)
CadaclysmRay
class CadaclysmRay extends RefCounted
The half-line from position along direction, as a value — Rhino's Ray3d. The direction is kept as given, not unitised, so t counts lengths of it; a zero one returns null, false or an empty value (the reason in Cadaclysm.last_error()). Shooting a ray at a solid is not here: see CadaclysmSolid.hits(). Immutable, with nothing to free: equal by value, hashable, iterating as its numbers, the maths the library's own, so every language answers alike. A frame argument is a CadaclysmFrame or 12 numbers; one within 1e-6 of right-handed and orthonormal is squared up, any other returns null, false or an empty value (the reason in Cadaclysm.last_error()), as does a size that is not positive and finite.
Points cross as Vector3s, so floats in a default build: compare them to 1e-5, not 1e-9. A point argument is a Vector3 or three numbers (an Array keeps a double's precision), and the array values keeps the doubles; GDScript has no operators on a class, so a.equals(b) is Python's a == b. A refused call returns null (NAN for a number or a point, false for contains) with the reason in Cadaclysm.last_error(). bounds() is an AABB, domain() an Array of two CadaclysmIntervals and corners() a PackedVector3Array.
CadaclysmRay.position
var position: Vector3 # read-only
var direction: Vector3 # read-only
The start and the direction.
CadaclysmRay.point_at()
func point_at(t: float) -> Vector3
position + t * direction, for any t — behind the start too, as Rhino's PointAt.
CadaclysmRay.closest_point()
func closest_point(p: Variant) -> CadaclysmCurveFoot
The CadaclysmCurveFoot on the ray nearest p: t clamped at 0, so a point behind the start answers the start. Always unique.
CadaclysmRay.bounds()
func bounds() -> AABB
A ray has no box: this returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmRay.transform()
func transform(t: Variant) -> CadaclysmRay
This ray under t (a CadaclysmTransform, or 16 numbers): any affine map, the position as a point and the direction as a vector. One that kills the direction returns null, false or an empty value (the reason in Cadaclysm.last_error()).
create, from_values, values and equals Godot only
static func create(position: Variant, direction: Variant) -> CadaclysmRay
static func from_values(values: Variant) -> CadaclysmRay
var values: PackedFloat64Array # read-only
func equals(other: Variant) -> bool
Python's Ray(...), with the same arguments, and the value from its raw array of 6 numbers, checked by the library (null for another count, in the library's words); the canonical array as a PackedFloat64Array (what Python's iteration gives); and Python's ==: the same kind with the same array. (new is GDScript's own, so the constructor is create.)
CadaclysmWorkplane
class CadaclysmWorkplane extends RefCounted
The fluent chain: a frame, the solid built so far, and the face last picked. A build step replaces the solid rather than adding to it — combine solids explicitly with CadaclysmSolid.join(). Every step returns null, false or an empty value (the reason in Cadaclysm.last_error()) at once rather than holding the error for later.
CadaclysmWorkplane.xy()
static func xy() -> CadaclysmWorkplane
Start on the XY plane at the origin (Z up). CadaclysmWorkplane.xz() and CadaclysmWorkplane.yz() start on the other two.
CadaclysmWorkplane.on()
static func on(frame: Variant) -> CadaclysmWorkplane
Start on any frame (see Frames).
CadaclysmWorkplane.from_solid()
static func from_solid(solid: CadaclysmSolid) -> CadaclysmWorkplane
Start from an existing solid, on the XY plane — the usual way to pick one of its faces and build on it.
CadaclysmWorkplane.frame
var frame: CadaclysmFrame # read-only
The current frame, 12 numbers.
A CadaclysmFrame.
CadaclysmWorkplane.cuboid()
func cuboid(x: float, y: float, z: float) -> CadaclysmWorkplane
A box x × y × z centred on the current frame's origin and aligned to its axes — on a picked face, half of it below the face; replaces the solid.
CadaclysmWorkplane.cylinder()
func cylinder(r: float, h: float) -> CadaclysmWorkplane
A cylinder of radius r and height h standing on the current frame; replaces the solid.
CadaclysmWorkplane.face()
func face(profile: CadaclysmProfile) -> CadaclysmWorkplane
The planar sheet the profile bounds on this frame — see CadaclysmSolid.face(); replaces the solid.
CadaclysmWorkplane.extrude()
func extrude(profile: CadaclysmProfile, height: float) -> CadaclysmWorkplane
The profile extruded height along the frame's z; replaces the solid.
CadaclysmWorkplane.revolve()
func revolve(profile: CadaclysmProfile, angle: float) -> CadaclysmWorkplane
The profile revolved angle radians about the frame's y axis; replaces the solid.
CadaclysmWorkplane.translate()
func translate(dx: float, dy: float, dz: float) -> CadaclysmWorkplane
Slide the current solid. Keeps the face selection — a rigid move keeps every face's index.
CadaclysmWorkplane.faces()
func faces(selector: Variant) -> CadaclysmWorkplane
Pick a face of the current solid with a Selector.
CadaclysmWorkplane.workplane()
func workplane() -> CadaclysmWorkplane
Move the frame onto the face last picked (outward normal as z), so the next step builds on it.
CadaclysmWorkplane.solid()
func solid() -> CadaclysmSolid
The solid built so far. On an empty chain it returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Selector and Axis
Which face to pick: the one furthest along an axis, furthest against it, the one facing a direction, or by index. Used by CadaclysmWorkplane.faces() and CadaclysmSolid.select_face().
No class: a selector is a String, ">Z" or "<X", a face index, or a normal as a Vector3.
Selector.normal
The face whose outward normal is nearest direction (need not be unit).
A Vector3, or three numbers.
CadaclysmSolid
class CadaclysmSolid extends RefCounted
An exact B-rep solid (or an open sheet): planes, cylinders, cones, spheres, tori and NURBS, trimmed and joined, never approximated by triangles. Immutable — every operation returns a new one. Close it when done, or let the language's scope do it; see Lifetimes.
Primitives
CadaclysmSolid.cuboid()
static func cuboid(x: float, y: float, z: float) -> CadaclysmSolid
A box x × y × z, centred on the origin.
CadaclysmSolid.cylinder()
static func cylinder(r: float, h: float) -> CadaclysmSolid
A cylinder of radius r, from z = 0 to h.
CadaclysmSolid.cone()
static func cone(r: float, h: float) -> CadaclysmSolid
A cone of base radius r and height h, apex up.
CadaclysmSolid.sphere()
static func sphere(r: float) -> CadaclysmSolid
A sphere of radius r about the origin.
CadaclysmSolid.torus()
static func torus(major: float, minor: float) -> CadaclysmSolid
A torus about the z axis: major to the tube's centre, minor the tube's radius. A tube wider than its ring (minor > major, a spindle) builds the solid it sweeps, the outer sheet with a pole at each end on the axis; minor == major is refused.
CadaclysmSolid.wedge()
static func wedge(x: float, y: float, z: float, top_x: float) -> CadaclysmSolid
A box whose top face is top_x long instead of x: a ramp.
CadaclysmSolid.pyramid()
static func pyramid(sides: int, r: float, h: float) -> CadaclysmSolid
A pyramid of sides sides (at least 3): its base the regular polygon of radius r on z = 0 (r to a corner, the first on +x), its tip at height h.
From a profile
CadaclysmSolid.extrude()
static func extrude(profile: CadaclysmProfile, frame: Variant, height: float) -> CadaclysmSolid
The profile on frame, extruded height along the frame's z.
CadaclysmSolid.extrude_open()
static func extrude_open(profile: CadaclysmProfile, frame: Variant, height: float) -> CadaclysmSolid
The walls only, no caps: an open sheet. Takes an open CadaclysmPath.end_open() chain as well as a closed profile.
CadaclysmSolid.extrude_tapered()
static func extrude_tapered(profile: CadaclysmProfile, frame: Variant, height: float, taper: float) -> CadaclysmSolid
Extrude with a draft: the walls lean out by taper radians as they rise (in, when negative). Every wall stays exact — a plane off a line, a cone off an arc.
CadaclysmSolid.extrude_open_tapered()
static func extrude_open_tapered(profile: CadaclysmProfile, frame: Variant, height: float, taper: float) -> CadaclysmSolid
The tapered walls without caps.
CadaclysmSolid.extrude_between()
static func extrude_between(profile: CadaclysmProfile, frame: Variant, bottom: Variant, top: Variant) -> CadaclysmSolid
Extrude between two planes rather than two heights: bottom and top are each a Slant (a bare number is a flat one). With both flat this is CadaclysmSolid.extrude(); with a slope it is the mitred end of a frame member. A top that comes down to or through the bottom returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.extrude_open_between()
static func extrude_open_between(profile: CadaclysmProfile, frame: Variant, bottom: Variant, top: Variant) -> CadaclysmSolid
CadaclysmSolid.extrude_between() without the caps.
CadaclysmSolid.revolve()
static func revolve(profile: CadaclysmProfile, axis_point: Variant, axis_direction: Variant, angle: float) -> CadaclysmSolid
The profile swung angle radians about axis (a point and a direction — see Frames). The profile's x is read as the radius and its y as the height along the axis, so it must lie to one side of it.
CadaclysmSolid.revolve_open()
static func revolve_open(profile: CadaclysmProfile, axis_point: Variant, axis_direction: Variant, angle: float) -> CadaclysmSolid
The revolved surface of an open profile: a sheet.
CadaclysmSolid.revolve_in_plane()
static func revolve_in_plane(profile: CadaclysmProfile, frame: Variant, a: Variant, b: Variant, angle: float) -> CadaclysmSolid
The profile on frame swung angle radians about the axis through the sketch points a and b (each (x, y) on the frame) — the profile and its axis drawn together, as a sketch draws them, where CadaclysmSolid.revolve() reads the profile as (radius, height). The profile may lie on either side of the axis and touch it (a half-disc with its diameter on the axis turns into a ball), but not cross it. The sweep starts where the profile is drawn and turns right-handed about b - a, so a partial turn leaves one end of the solid over the profile itself.
CadaclysmSolid.revolve_open_in_plane()
static func revolve_open_in_plane(profile: CadaclysmProfile, frame: Variant, a: Variant, b: Variant, angle: float) -> CadaclysmSolid
CadaclysmSolid.revolve_in_plane() for a curve: its segments swung into a sheet, no caps.
CadaclysmSolid.coil()
static func coil(profile: CadaclysmProfile, axis_point: Variant, axis_direction: Variant, pitch: float, turns: float) -> CadaclysmSolid
The profile coiled about axis (a point and a direction): read as CadaclysmSolid.revolve() reads it — x the distance from the axis, y along it — and turned turns times while climbing pitch along the axis each turn: a spring, a thread. The walls follow the helix to a few millionths of the radius (a helix is not a NURBS curve, so they are a close fit, exact at both ends); the two ends are the profile itself, flat. A profile reaching the axis, one with holes, or — from a full turn up — a pitch no taller than the profile returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.loft()
static func loft(a: CadaclysmProfile, frame_a: Variant, b: CadaclysmProfile, frame_b: Variant) -> CadaclysmSolid
The solid between profile a on one frame and b on another: ruled walls between matching sides (both profiles need the same number of sides, and no holes), capped by the two.
CadaclysmSolid.loft_open()
static func loft_open(a: CadaclysmProfile, frame_a: Variant, b: CadaclysmProfile, frame_b: Variant) -> CadaclysmSolid
The ruled walls without the caps.
CadaclysmSolid.loft_through()
static func loft_through(sections: Array) -> CadaclysmSolid
The solid smooth through every section — a profile on its frame, in order: each wall interpolates its side across all the profiles (cubic through four or more, quadratic through three, CadaclysmSolid.loft() through two), capped by the first and the last. Every section of the result is its profile exactly, arcs and all. The profiles must have the same number of sides and no holes; otherwise returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.loft_through_open()
static func loft_through_open(sections: Array) -> CadaclysmSolid
The walls through the curves without the caps: an open sheet.
CadaclysmSolid.sweep()
static func sweep(profile: CadaclysmProfile, frame: Variant, path: CadaclysmSweepPath) -> CadaclysmSolid
The profile on frame, carried along a CadaclysmSweepPath. A straight piece is an extrusion and an arc a revolution about the arc's axis, so nothing is approximated — a circle along an arc is an exact torus wall.
CadaclysmSolid.sweep_open()
static func sweep_open(profile: CadaclysmProfile, frame: Variant, path: CadaclysmSweepPath) -> CadaclysmSolid
The swept walls without caps: an open sheet.
CadaclysmSolid.pipe()
static func pipe(path: CadaclysmSweepPath, radius: float, thickness: float = 0.0) -> CadaclysmSolid
A circle of radius carried along a CadaclysmSweepPath, square to where it starts: a solid rod, or with a positive thickness a tube whose walls are that thick. The path is only borrowed, as by CadaclysmSolid.sweep(), and refused the same way.
CadaclysmSolid.extrude_faces()
func extrude_faces(height: float) -> CadaclysmSolid
Every face of a sheet pushed height along its own normal, walled and closed: the sheet as a solid of that thickness.
CadaclysmSolid.face()
static func face(profile: CadaclysmProfile, frame: Variant) -> CadaclysmSolid
The flat sheet a profile bounds on frame: one planar face, each hole a hole through it, its normal the frame's z however the profile winds, every edge the exact line, arc or spline its segment is. An open sheet — raise it with CadaclysmSolid.extrude_faces(), cut it with CadaclysmSolid.trim().
Placing
CadaclysmSolid.place()
func place(frame: Variant) -> CadaclysmSolid
A solid built about the origin moved onto frame: its origin to the frame's origin, its axes to the frame's (see Frames).
CadaclysmSolid.translate()
func translate(dx: float, dy: float, dz: float) -> CadaclysmSolid
Moved by (dx, dy, dz).
CadaclysmSolid.scale()
func scale(factor: float) -> CadaclysmSolid
Scaled by factor about the origin: every length times factor, exactly. factor must be positive and finite.
CadaclysmSolid.rotate()
func rotate(axis_point: Variant, axis_direction: Variant, radians: float) -> CadaclysmSolid
Turned radians about axis (a point and a direction).
CadaclysmSolid.mirror()
func mirror(plane: Variant) -> CadaclysmSolid
Reflected across plane: a frame whose z is the mirror plane's normal.
CadaclysmSolid.transform()
func transform(t: Variant) -> CadaclysmSolid
Through the affine map t — a CadaclysmTransform, or 16 numbers row-major — exactly, colours and name kept. A rigid map or a similarity keeps every surface's kind; a map within 1e-6 of a similarity (AᵀA against k²I, relative to k²: a rotation written in float32 among them) is applied as the exact similarity nearest it, moving a point p by at most about 1e-6·|A|·|p|. Any other map — a non-uniform scale, a shear — turns the curved surfaces into their exact NURBS and maps those. A singular map returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.convert_to_nurbs()
func convert_to_nurbs(level: String = "all") -> CadaclysmSolid
Every surface level selects rewritten as its exact NURBS: "procedural" the revolutions, extrusions and sums; "analytic" those and the cylinders, cones, spheres and tori; "all" everything, planes and edge curves too. Colours and name kept.
CadaclysmSolid.inexact_trims
var inexact_trims: int # read-only
On a solid from CadaclysmSolid.transform() or CadaclysmSolid.convert_to_nurbs(), the trims that call lost: face boundaries kept only as a polyline lifted through the old surface, where no exact edge curve was left. Per call — not the solid's history — and 0 for a rigid map or a similarity, and on every other solid.
Booleans
CadaclysmSolid.join()
func join(other: CadaclysmSolid, tolerance: float = 0.05, merge: bool = false) -> CadaclysmSolid
The union with other, as an exact B-rep. merge (off by default, so face and edge numbers stay as they were) merges the flush faces the join leaves, as CadaclysmSolid.merge_flush() does — Go takes it as a trailing true, Java as an overload; CadaclysmSolid.cut() and CadaclysmSolid.common() take it too. tolerance (0.05 by default) is the mesh tolerance the boolean decides at: both solids are meshed at it, so a tighter one is as correct and slower. It is also the resolution: two faces on one surface to within it — a peg the size of its hole, or a hair thinner — are one surface, and the join is a fit; a gap wider than it is a gap. progress, where the wrapper takes one, is called with a phase name and a done/total count.
CadaclysmSolid.cut()
func cut(other: CadaclysmSolid, tolerance: float = 0.05, merge: bool = false) -> CadaclysmSolid
This solid with other removed.
CadaclysmSolid.common()
func common(other: CadaclysmSolid, tolerance: float = 0.05, merge: bool = false) -> CadaclysmSolid
What this solid and other share.
CadaclysmSolid.intersect()
func intersect(other: CadaclysmSolid, tolerance: float = 0.05) -> CadaclysmIntersection
Where this solid's faces cross or coincide with other's, at tolerance, as an CadaclysmIntersection: every crossing as a CadaclysmChain, every coincident face pair that shares a region as an CadaclysmOverlap. Not a boolean: neither solid changes, nothing is built. tolerance (0.05 by default) is read as CadaclysmSolid.join()'s — both solids' mesh resolution and how close a point may sit to both faces' exact surfaces to be reported. No crossing at all is an empty CadaclysmIntersection, never an error. progress, where the wrapper takes one, is called with a phase and a done/total count: meet on the exact route; mesh, cull, cross, snap, curve where it falls back to the mesh route.
There is one chain per face pair per branch: a chain does not cross a face boundary or a closed curve's own seam, so a crossing that runs past either comes back as more than one chain, joined by matching ends. Two faces on one surface sharing no region — an edge or a rim resting against another face, two flush faces meeting along a line — are silent: neither a chain nor an overlap. Known limit: a crossing narrower than tolerance — two surfaces passing within it of each other without their meshes actually crossing — can be missed; where this bites the surfaces are near-tangent, and the chain that is found (if any) carries tangent.
CadaclysmSolid.self_intersections()
func self_intersections(tolerance: float = 0.05) -> CadaclysmIntersection
Where this solid passes through itself, at tolerance, as an CadaclysmIntersection — what CadaclysmSolid.intersect() reports with this solid on both sides, so every CadaclysmChain and CadaclysmOverlap names two faces of this solid. Never along its own topology: faces meeting at the edges and vertices they share are not a crossing, so a clean solid is an empty CadaclysmIntersection, never an error. A chain whose two faces are one face is that face folding through itself, and has no curve. The solid is not changed; it may be an open sheet. tolerance (0.05 by default) is the mesh resolution, as CadaclysmSolid.intersect()'s: the solid is meshed once and crossed against itself, the exact face-pair engine refining each crossing of two faces, so the same known limit holds — a crossing narrower than tolerance can be missed. progress, where the wrapper takes one, hears mesh, cull, cross, snap, curve. A tolerance not positive and finite, a solid with no faces or one that meshes to nothing, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.check()
func check(other: CadaclysmSolid, operation: String = "", tolerance: float = 0.05) -> Variant
What is wrong with this solid (and other, if given) as the arguments of operation, at tolerance, as a list of CadaclysmFinding — OCCT's BRepAlgoAPI_Check, gathered from what the kernel already measures. An empty list is a valid pair; nothing is changed. Each argument is checked alone whatever the operation: no faces, features smaller than tolerance as CadaclysmSolid.health() finds them, shared edges whose sides part, edges that leave a face's surface, creases where the geometry is only C0, and where it passes through itself as CadaclysmSolid.self_intersections() finds it. operation — join, cut, common, split_sheet, trim, merge or intersect — adds what that verb refuses each argument for: a boolean wants both closed (one open finding per free edge) and holding no region wall (a merge's body); a split or trim only its tool closed; a merge closed manifolds of planes, cylinders, cones, spheres and tori. Without other, this solid is held to what the operation asks of its first argument. A free edge is no fault without an operation that asks for a closed solid: an open sheet is a fine body.
An edge leaves a face's surface (curve_on_surface) where its descriptions — its trim in the face's parameters carried onto the surface, its curve and its polyline in space — part from the surface, or from one another there, by more than tolerance (or the edge's own recorded tolerance, if larger); a polyline is measured at its points only, so a file's coarse flattening is no fault. A crease (c0_inside) is a line where the geometry turns a corner inside a face — a spline knot of full multiplicity, a kink in a swept surface's profile, every point of a profile a file flattened to a polyline — or along an edge's own curve, sharper than the angular tolerance: the solid's declared one, else the tolerance.angular option (one degree). A knot where the two sides meet tangent is no crease, unlike OCCT's check, which flags any C0 parametrisation. Both are sampled, so a deviation narrower than the sampling can be missed.
With other, the sub-shapes of the two a boolean would merge or struggle with come too, whatever the operation, each as a finding with argument 0, index in this solid and other in other: two vertices further apart than the weld (1e-6, inside which two points are one) but within tolerance (merge_vertex); two edges running along one another within tolerance and parallel within the angular tolerance over a stretch longer than tolerance, without being one edge (merge_edge); two faces lying on one another only within tolerance (merge_face); and two faces whose crossing runs where they are tangent within the angular tolerance — a cylinder lying on a block, which a join refuses as touching itself along a line (tangent_face). Vertices, edges and faces exactly on one another are what a boolean handles, and are none. The face findings are read off CadaclysmSolid.intersect()'s answer, so a point contact, which has no crossing, is not found, and a crossing shallower than the angular tolerance is a crossing. progress, where the wrapper takes one, hears health, curve_on_surface and continuity, then the self-intersection's phases, then — with other — pairs. An unknown operation or a tolerance not positive and finite, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
other has no default here: pass null to check this solid alone (solid.check(null)).
CadaclysmSolid.section()
func section(z: float, tolerance: float = 0.05) -> Array[CadaclysmProfile]
This solid cut by the plane Z = z: its closed outlines there, in XY, nested into profiles with holes (boundaries counter-clockwise, holes clockwise), a line or a circle crossing kept exact and any other curve as lines within tolerance. A plane that misses the solid is an empty list. A z not finite, a tolerance (0.05 by default) not positive and finite, a face lying in the plane (section a little above or below it), or a crossing that does not close, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.section_curves()
func section_curves(origin: Variant, normal: Variant, tolerance: float = 0.0) -> Array[CadaclysmSectionCurve]
This body cut by the plane through origin square to normal, as curves in space, as Rhino's Intersection.BrepPlane: each a CadaclysmSectionCurve, each closed section loop one closed curve, an open sheet's crossing one open curve. A crossing on a line, circle, ellipse or NURBS is that curve exactly; any other a cubic fitted at tolerance (0 or null the body's own; its error says how far). A face lying in the plane gives its own edges, exactly. A plane missing the body gives an empty list.
CadaclysmSolid.contour_curves()
func contour_curves(start: Variant, end: Variant, interval: float, tolerance: float = 0.0) -> Array[CadaclysmSectionCurve]
This body cut by the planes square to end - start through start and every interval on towards end, as Rhino's Brep.CreateContourCurves, as CadaclysmSolid.section_curves() cuts by one: every plane's CadaclysmSectionCurves in plane order, each one's plane its index. start and end the same point, an interval not positive and finite, or more than 10,000 planes, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.hits()
func hits(profile: CadaclysmProfile, frame: Variant, tolerance: float = 0.05) -> CadaclysmSolidHits
Where profile, placed on frame, pierces this solid's faces, and the pieces its loops cut into, as a CadaclysmSolidHits. Neither is changed. A point hit lies within tolerance of the segment's exact curve and of the face's exact surface, inside the face's trim; its profile spot (CadaclysmHit.a_start: loop, segment, t) and face spot (CadaclysmHit.b_start: face, u, v) evaluate to the point within tolerance; touch where the curve's tangent lies within 1e-3 (sine) of the surface's tangent plane there (a graze), false at a crossing. A run is a stretch of one segment lying within tolerance of one face and inside it, longer than tolerance. Hits within tolerance of each other merge (a hit at a segment join reported once, as (k, t = 1); a closed loop's closing join reads (0, 0)). Every point is in world space (the frame applied).
Pieces (CadaclysmPiece) only for a closed body — an open body has none — in loop order, covering every loop exactly; a piece's spots read a segment join as the next segment's start (k + 1, 0), and an open chain runs from (0, 0) to (n - 1, 1); a loop no hit cuts is one closed piece. inside by the piece middle's winding number over the body's mesh; a piece lying on the surface is inside. Known limit: a segment passing within tolerance of a face without its polyline crossing the mesh can be missed (near-tangent grazes).
progress, where the wrapper takes one, is called with phases mesh, cull, hits and pieces and a done/total count. A tolerance not positive and finite, a solid with no faces or that meshes to nothing, a profile with no segments, or a free-form segment that is not an evaluable NURBS curve returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.split_sheet()
func split_sheet(tool: CadaclysmSolid, tolerance: float = 0.05) -> CadaclysmSolid
This solid or sheet cut along tool's boundary with nothing removed: each face comes back as its pieces outside tool and then its pieces inside, in the original face order — the start of a surface trim. tool must be a closed solid. Keep the pieces you want with CadaclysmSolid.drop_faces(), or split and drop in one call with CadaclysmSolid.trim().
Faces and sheets
CadaclysmSolid.face_sheet()
func face_sheet(face: int) -> CadaclysmSolid
One face alone, as an open sheet: its surface, its loops and the exact curves on its edges, the rest of the solid left behind — raised by CadaclysmSolid.extrude_faces() it is the prism over that face. Keeps the face's colour.
CadaclysmSolid.drop_faces()
func drop_faces(faces: PackedInt32Array) -> CadaclysmSolid
This solid without the faces listed: the rest keep their surfaces, curves and colours in their order, so an index into the result is this one's with the dropped ones closed up. Dropping every face returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.trim()
func trim(tool: CadaclysmSolid, keep: String = "outside", tolerance: float = 0.05) -> CadaclysmSolid
This sheet (or solid) cut along the closed tool's boundary and the pieces on one side thrown away: keep "outside" (the default) keeps what lies outside the tool — a hole punched through — and "inside" what lies within it. Nothing on the kept side returns null, false or an empty value (the reason in Cadaclysm.last_error()). tolerance and progress as for CadaclysmSolid.join().
CadaclysmSolid.split_by_curve()
func split_by_curve(curve: CadaclysmNurbsCurve, direction: PackedFloat64Array = PackedFloat64Array(), tolerance: float = 0.05) -> CadaclysmSolid
This sheet cut along curve — a CadaclysmNurbsCurve lying on it, typically projected or pulled onto it — with nothing removed: each face comes back as its pieces outside the cutter and then its pieces inside, as CadaclysmSolid.split_sheet() orders them. The cutter is the curve run along direction (null: the mean of the sheet's normals along the curve) through the whole sheet, so the cut follows the curve wherever the sheet is one layer along that direction. A closed curve's inside is the island it bounds; an open curve's is the side left of its run, seen from where direction points, and an open curve is run on straight past both ends, so it should reach the sheet's boundary. Where the cut lies on the curve — a curve drawn on the sheet — the rim is one edge carrying the curve's own span exactly, its ends on the curve, so another sheet built along the same curve sews to it with CadaclysmSolid.join_sheets(). A direction that is zero, or a curve running along it, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
direction is a PackedFloat64Array, empty (the default) for none.
CadaclysmSolid.trim_by_curve()
func trim_by_curve(curve: CadaclysmNurbsCurve, keep: String = "outside", direction: PackedFloat64Array = PackedFloat64Array(), tolerance: float = 0.05) -> CadaclysmSolid
This sheet cut along curve and one side thrown away (see CadaclysmSolid.split_by_curve()): keep "outside" (the default) keeps the sheet with the hole a closed curve cuts, "inside" the island; for an open curve "left" (the same as "inside") keeps the side left of its run seen from where direction points, "right" the other. Nothing on the kept side returns null, false or an empty value (the reason in Cadaclysm.last_error()). The kept pieces keep their faces' colours.
direction is a PackedFloat64Array, empty (the default) for none.
CadaclysmSolid.flange()
func flange(edges: Variant, section: CadaclysmNurbsCurve, tolerance: float = 1e-3, join: bool = true) -> CadaclysmSolid
A section swept along each of edges — naked edges of this sheet, bordered by one face — on the face's own frame, the new sheets sewn to this one: at every point of the edge the section's x runs outward from the face (square to the edge, in its tangent plane) and its y along the face's normal, so a section from (0, 0) to (0, -10) turns the edge under by 10 all along it however the panel curves — a flange round an opening, a wheel arch's lip, a door-seal return — (0, 0) to (10, 0) carries the face on, and a lip stands proud with y > 0. section is a CadaclysmNurbsCurve in the plane z = 0 starting at the origin. With join false the sweeps come back alone, sewn to each other. Each is fitted within tolerance, and its side along the edge too; sheet_error says how close. An edge bordered by two faces, a section not starting at the origin, or sweeps that did not sew on returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.extrude_to()
func extrude_to(edges: Variant, direction: Variant, target: CadaclysmSolid, tolerance: float = 1e-3, join: bool = true) -> CadaclysmSolid
Each of edges — naked edges of this sheet — slid along direction until it meets target: every point of the edge travels along the direction to its first hit on target's faces (the trimmed faces, not their whole surfaces). One wall per edge, the edge's own curve swept straight and bounded by the curve through the hits, fitted within tolerance of every hit (sheet_error), so the wall shares the edge exactly and meets the target within the tolerance — a wheel arch cut in a panel run in to the well's inner wall as its liner. The walls come back sewn to this sheet, or alone with join false. A direction of no length, or a point whose line misses the target (named), returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.split_along_curve
This sheet cut along curve, a CadaclysmNurbsCurve lying on it (within ten times tolerance), with no direction: each face is cut in its own parameters where the curve crosses it, so the cut follows the curve however far the sheet rolls, and runs on across the seams of a joined sheet. An open curve is carried on along the sheet past both ends to its boundary; a closed one cuts out the island it bounds. Nothing is removed. Where the cut lies on the curve the rim is one edge carrying the curve's own span exactly. A curve that leaves the sheet returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Not in the Godot add-on yet.
CadaclysmSolid.panel_gap
This sheet parted along curve (lying on it, as for CadaclysmSolid.split_along_curve) into two panels with a shut line between them — a car body's panel gap: each trimmed back gap / 2 from the curve, measured along the sheet, and given a flange flange along the faces' outward normals on the edge it was cut back to (negative turns it under; 0 for none). Only the cut edges are flanged, not the sheet's own edges, and each flange ends square where the curve runs off the sheet. The panel left of the curve's run (seen from the outward side) first, then the right one; a loop run counter-clockwise from that side has the island on its left. A curve that leaves the sheet, or a gap that leaves nothing of a panel, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Not in the Godot add-on yet.
CadaclysmSolid.join_sheets()
static func join_sheets(sheets: Array, tolerance: float = 0.0) -> Variant
Separate sheets joined into one body, their faces in order, beside a CadaclysmJoinReport of what was done: every two naked edges whose ends and curves agree within tolerance (0: a rounding of the body's size) sewn into one edge — a gap closed is kept as that edge's own tolerance, nothing moves — the faces turned to agree across their edges, and a closed result turned to face out: a solid CadaclysmSolid.cut(), CadaclysmSolid.mass() and the writers take like any other. Edges that carry exact curves are compared to the tolerance however coarsely each sheet sampled them. One sheet's edge running along part of another's is not sewn and stays naked. No sheets, a negative tolerance, or faces that cannot be turned to agree (a one-sided surface) returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Returns an Array [solid, report], the report a CadaclysmJoinReport, or null with the reason in Cadaclysm.last_error().
CadaclysmSolid.mirror_join()
func mirror_join(plane: Variant, snap: float = 0.0, tolerance: float = 0.0) -> Variant
This half and its reflection across plane (a CadaclysmFrame, its z the plane's normal) joined into one symmetric body — half a car, a hull or a bottle modelled once and mirrored — the half's faces first, beside a CadaclysmSymmetryReport of how well the seam on the plane meets. With snap above 0, every NURBS face that is its whole surface and has a side whose control points all lie within snap of the plane is squared to it first: that side pulled onto the plane and the next row of control points stood straight off it along the plane's normal, keeping its distance from the plane. The surface then crosses the plane at 90 degrees, so it meets its mirror tangent and curvature continuous; nothing past that row moves, and neighbouring faces along the plane whose shared side agrees are squared alike and sew back. snap 0 mirrors the half as it is, a crease wherever it leans. The halves are sewn within tolerance (0: a rounding of the body's size). A half on both sides of the plane, no edge of it on the plane, or a face that cannot be squared (its next row on the plane or past it) returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Returns an Array [solid, report], the report a CadaclysmSymmetryReport, or null with the reason in Cadaclysm.last_error().
CadaclysmSolid.pattern()
func pattern(transforms: Array, tolerance: float = 0.0) -> Variant
This body and its copies at transforms (rigid CadaclysmTransforms, typically from CadaclysmPattern, instance 0 the identity keeping the original) as one body — a pattern of bodies — beside a CadaclysmPatternReport. Copies apart from each other are put together with no boolean at all; copies that overlap are joined, one boolean a group. No transforms, or one that is not rigid, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Returns an Array [solid, report], the report a CadaclysmPatternReport, or null with the reason in Cadaclysm.last_error().
CadaclysmSolid.pattern_feature()
func pattern_feature(tool: CadaclysmSolid, op: String, transforms: Array, tolerance: float = 0.0) -> Variant
tool — any closed solid, typically a _tool call's result — placed at each of transforms and applied to this body by op, "cut" or "join": a pattern of features, Fusion's compute type *identical*, beside a CadaclysmPatternReport. Copies apart from each other are one multi-lump tool and one boolean, however many there are; overlapping copies fall into a few groups. A copy that shares no volume with the body is missed: dropped for a cut, kept as a body of its own for a join. An unknown op, no transforms, one not rigid, or a tool that is not closed returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Returns an Array [solid, report], the report a CadaclysmPatternReport, or null with the reason in Cadaclysm.last_error().
CadaclysmSolid.hole()
func hole(points: Variant, diameter: float, direction: PackedFloat64Array = PackedFloat64Array(), extent: String = "through", depth: float = f64.NAN, tip_angle: float = 2.0594885173533086, face: int = -1, head: String = "simple", head_diameter: float = 0.0, head_depth: float = 0.0, head_angle: float = 1.5707963267948966, tolerance: float = 0.0) -> Variant
func hole_threaded(points: Variant, diameter: float, thread: Dictionary, direction: PackedFloat64Array = PackedFloat64Array(), extent: String = "through", depth: float = f64.NAN, tip_angle: float = 2.0594885173533086, face: int = -1, head: String = "simple", head_diameter: float = 0.0, head_depth: float = 0.0, head_angle: float = 1.5707963267948966, tolerance: float = 0.0) -> Variant
This body drilled at points — one point, or several: one hole each, all of one spec, in one cut — beside a CadaclysmHoleReport. The bore is an exact cylinder of diameter, a counterbore an exact cylinder, a countersink and a drill point exact cones. direction is the drilling direction, into the material, shared by every point; null drills each point along the inward normal of the face it lies on (on an edge, the lowest-numbered face's).
extent: "through" everything ahead of the point; "blind", depth of full bore then a drill point of included angle tip_angle (0 or pi: a flat bottom); "to_face", until the axis first meets face face, the bore ending on it whatever its shape; "to_next", until the bore first leaves the material (OCCT's thru-next). head: null, "counterbore" (head_diameter across, head_depth deep) or "countersink" (head_diameter across at the point, included angle head_angle), measured from the point. Angles in radians. An unknown choice, a diameter not positive, a depth or face its extent does not take, a head not wider than the bore, an angle out of range, a point not on a face with no direction, a hole that removes nothing, or a face the axis never meets returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Tapped holes: thread (a designation or a CadaclysmThreadSize) taps every hole. A diameter of 0 is then the tap drill (major - pitch), a given one must lie in the thread's internal band, and a head must be wider than the major. The thread starts at the point (a counterbore's floor) and runs thread_depth (null: the bore's length). thread_modelled cuts it in one more boolean after the holes; false drills the bore alone and writes a cosmetic record on each hole's bore face (CadaclysmSolid.thread_record()). left_handed climbs the other way; the report's thread_depths has one per hole.
Returns an Array [solid, report], the report a CadaclysmHoleReport, or null with the reason in Cadaclysm.last_error(). A tapped hole is hole_threaded(points, diameter, thread, ...) (its tool hole_threaded_tool), the thread one Dictionary {size, depth, modelled, left_handed}: a Godot method takes at most 14 arguments.
CadaclysmSolid.hole_tool()
func hole_tool(points: Variant, diameter: float, direction: PackedFloat64Array = PackedFloat64Array(), extent: String = "through", depth: float = f64.NAN, tip_angle: float = 2.0594885173533086, face: int = -1, head: String = "simple", head_diameter: float = 0.0, head_depth: float = 0.0, head_angle: float = 1.5707963267948966, tolerance: float = 0.0) -> CadaclysmSolid
func hole_threaded_tool(points: Variant, diameter: float, thread: Dictionary, direction: PackedFloat64Array = PackedFloat64Array(), extent: String = "through", depth: float = f64.NAN, tip_angle: float = 2.0594885173533086, face: int = -1, head: String = "simple", head_diameter: float = 0.0, head_depth: float = 0.0, head_angle: float = 1.5707963267948966, tolerance: float = 0.0) -> CadaclysmSolid
The tool CadaclysmSolid.hole() cuts with, from the same arguments: a closed solid, one lump a point — for CadaclysmSolid.pattern_feature() or a boolean of your own. A modelled thread's coils are joined into it (one more boolean, the tool's alone).
CadaclysmSolid.thread()
func thread(face: int, size: String = "", pitch: float = f64.NAN, diameter: float = f64.NAN, length: float = f64.NAN, offset: float = 0.0, reverse: bool = false, left_handed: bool = false, angle: float = 1.0471975511965976, tolerance: float = 0.0) -> Variant
This body with a screw thread cut into cylindrical face face — external on a rod, internal in a bore (the face's normal decides) — beside a CadaclysmThreadReport. The cutter is one coil of the basic ISO 68-1 profile at angle (the included flank angle, radians; 60 degrees by default), cut in one boolean.
size is a designation ("M10", "m10 x 1.25", "1/4-20": CadaclysmBlacksmith.thread_size()'s forgiving lookup) or a CadaclysmThreadSize; without one, pitch is required and diameter is the major (null: the face's diameter on a rod, the face taken as the basic minor in a bore). The face must lie in the thread's band: external [D2, D + P/8], internal [D1 - P/8, D2]. The span runs along the axis from the face's open end (air past it: a rod's tip, a bore's mouth; else the end lower along the face cylinder's axis; reverse the other) after offset, for length (null: the rest of the face). Where it ends at an open end the groove runs out through it; elsewhere the coil stops on its own cap, under a pitch short (no run-out). left_handed climbs the other way. A face past the end or not cylindrical, a size not in the table, a size and a pitch or diameter both given, neither, figures not positive, an angle out of range, the face outside the band, the span past the face, or a cut that removes nothing returns null, false or an empty value (the reason in Cadaclysm.last_error()).
size is a designation (a CadaclysmThreadSize's designation), empty for none; NAN for the figures left unset. Returns an Array [solid, report], the report a CadaclysmThreadReport, or null with the reason in Cadaclysm.last_error().
CadaclysmSolid.thread_tool()
func thread_tool(face: int, size: String = "", pitch: float = f64.NAN, diameter: float = f64.NAN, length: float = f64.NAN, offset: float = 0.0, reverse: bool = false, left_handed: bool = false, angle: float = 1.0471975511965976, tolerance: float = 0.0) -> CadaclysmSolid
The cutter CadaclysmSolid.thread() cuts with, from the same arguments: one closed coil.
size is a designation (a CadaclysmThreadSize's designation), empty for none; NAN for the figures left unset.
CadaclysmSolid.cosmetic_thread()
func cosmetic_thread(face: int, size: String = "", pitch: float = f64.NAN, diameter: float = f64.NAN, length: float = f64.NAN, offset: float = 0.0, reverse: bool = false, left_handed: bool = false, tolerance: float = 0.0) -> CadaclysmSolid
This body unchanged but for a cosmetic thread on face face: validated as CadaclysmSolid.thread() validates it (60 degree flanks), its figures written as the face's attributes thread.designation, thread.major, thread.pitch, thread.length, thread.offset, thread.internal, thread.left_handed and thread.reverse — strings, so they go wherever face attributes go, and every verb carries them to the faces of its result. Refused as CadaclysmSolid.thread() is.
size is a designation (a CadaclysmThreadSize's designation), empty for none; NAN for the figures left unset.
CadaclysmSolid.thread_record()
func thread_record(face: int) -> CadaclysmThreadRecord
Face face's cosmetic thread as a CadaclysmThreadRecord, or null where it carries no complete record (every thread.* attribute present and parsable). A face past the end returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.thread_records()
func thread_records() -> Array
Every face's cosmetic thread, as (face, record) pairs in face order.
CadaclysmSolid.rib()
func rib(curve: CadaclysmNurbsCurve, plane: Variant, thickness: float, side: String = "both", toward: PackedFloat64Array = PackedFloat64Array(), tolerance: float = 0.0) -> CadaclysmSolid
This body with a rib along curve, an open CadaclysmNurbsCurve lying in plane (a CadaclysmFrame): the region of the plane between the curve and the body on the toward side (a direction in the plane; null: toward the body's nearest point), the curve's ends carried on along their tangents until they meet the body, thickened thickness along the plane's normal — side "both" (half each side), "front" (+z) or "back" (-z) — and joined in one boolean (OCCT's linear form). An unknown side, a curve closed or not in the plane, a thickness not positive, a slab that meets nothing, or a region not closed by the body returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.rib_tool()
func rib_tool(curve: CadaclysmNurbsCurve, plane: Variant, thickness: float, side: String = "both", toward: PackedFloat64Array = PackedFloat64Array(), tolerance: float = 0.0) -> CadaclysmSolid
The slab CadaclysmSolid.rib() joins, alone, from the same arguments.
CadaclysmSolid.rib_revolved()
func rib_revolved(curve: CadaclysmNurbsCurve, axis_point: Variant, axis_direction: Variant, angle: float, toward: PackedFloat64Array = PackedFloat64Array(), tolerance: float = 0.0) -> CadaclysmSolid
This body with a revolved rib: the region CadaclysmSolid.rib() would fill, drawn in the plane holding the axis (through axis_point along axis_direction) and curve (an open CadaclysmNurbsCurve in that plane), clipped to the curve's side of the axis and swung angle radians about it, symmetric about the curve's plane, then joined in one boolean. toward as CadaclysmSolid.rib()'s. An angle not in (0, 2 pi), a zero axis direction, a curve closed or not in one plane with the axis, a slab that meets nothing, or a region not closed by the body returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.rib_revolved_tool()
func rib_revolved_tool(curve: CadaclysmNurbsCurve, axis_point: Variant, axis_direction: Variant, angle: float, toward: PackedFloat64Array = PackedFloat64Array(), tolerance: float = 0.0) -> CadaclysmSolid
The solid CadaclysmSolid.rib_revolved() joins, alone, from the same arguments.
CadaclysmSolid.web()
func web(curves: Variant, plane: Variant, thickness: float, side: String = "both", depth: float = f64.NAN, both_ways: bool = false, tolerance: float = 0.0) -> CadaclysmSolid
This body with a web along each of curves (one open CadaclysmNurbsCurve or several, in plane): each offset in the plane to thickness — side "both", "left" or "right" of the curve's run, the plane's normal up — its ends carried along their tangents to the body, its walls run along the plane's normal until they meet the body (depth null) or for depth, one way (the normal's) or both when both_ways. All the webs are one tool and one join; crossing curves make a network. An unknown side, no curves, one closed or not in the plane, a thickness not positive, or walls that meet nothing or are not closed by the body returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.web_tool()
func web_tool(curves: Variant, plane: Variant, thickness: float, side: String = "both", depth: float = f64.NAN, both_ways: bool = false, tolerance: float = 0.0) -> CadaclysmSolid
The walls CadaclysmSolid.web() joins, alone, from the same arguments.
CadaclysmSolid.recess
This sheet with an opening recessed into it along outline — a window, a lamp, a grille or an air intake set into a panel — beside how many of the result's faces are each part's: the sheet's, the fillet's, the walls' and the pane's, the faces in that order. outline is a closed CadaclysmNurbsCurve on the sheet (one face, or several joined by CadaclysmSolid.join_sheets()); each of its points is found on the sheet, so a curve drawn a little off it recesses cleanly. The sheet is cut along it and walls run back depth along the sheet's own normal at every point of the rim — not along one view, so an opening set into a panel that rolls over from side to roof still runs straight in — behind the face (against its normal; negative: in front), leaning in toward the opening by draft radians (negative: out) and meeting on the mitre at the outline's corners. fillet above 0 rounds the rim between the sheet and the walls with a ball of that radius; pane closes the back with one patch whose four sides end where the outline turns most — a rectangle's corners, the middle of a rounded rectangle's corner arcs — so it does not twist. Every piece is sewn to the next: only the sheet's own boundary is left naked, and the walls' foot where there is no pane. An outline that is not closed, a corner with a fillet, or a fillet deeper than the walls returns null, false or an empty value (the reason in Cadaclysm.last_error()).
The C API and the other wrappers have it.
CadaclysmSolid.health()
func health(tolerance: float = 0.0, mesh: bool = false) -> Dictionary
What is wrong with this solid, as a HealthReport: the free edges and the wires they chain into, each with its nearest partner and the gap to it; the features below tolerance; the loose edges; and what sewing would join and leave. Nothing moves. tolerance is an absolute length, as Rhino's model tolerance is, by default 1e-4 times the diagonal; a NaN, infinite, zero or negative one takes the default, and the report shows what was used. A partner is the nearest free edge other than a neighbour on the wire, so a rim reads as a gap the size of the part; shared_ends 2 is what CadaclysmSolid.join_sheets() joins. mesh=True also meshes the solid and reports where the mesh cracks; an open body's crack census is empty by design (not asked), and cracks are only counted on a closed body. Loose edges are compared against the larger of the tolerance recorded and the one given. A solid that cannot be read returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Returns the report as a Dictionary (see HealthReport); an empty one on failure. tolerance defaults to 0, which, as any value not finite and positive, takes the library's default.
CadaclysmSolid.heal()
func heal(tolerance: float = 0.0, edges: bool = true, faces: bool = true, holes: bool = true) -> Dictionary
This solid with its small features removed, beside a HealReport of what was done and left, as a new CadaclysmSolid; this one is left as it was. It heals what CadaclysmSolid.health() lists as small at the same tolerance, so health first tells what it will do.
Each kind's fix: a short edge's two ends are merged into one vertex and the edge dropped; a collapsed edge (a trim collapsed to a point where its surface is not singular) is dropped; a sliver face's short ends are merged, then the face is dropped and its two long sides sewn into one edge; a tiny face's corners are merged into one vertex and the face is dropped with its edges; a small hole (an inner loop whose edges are all free: a pinhole in an open sheet) is dropped from its face. A hole with walls (a bore) is not a small hole, and a tiny body is listed but never removed.
Everything is a vertex merge no wider than tolerance: a cluster of vertices that spans more, measured by every trim end at them, is refused (chain), so a run of short edges cannot swallow a long one, nor a loosely written corner move an end further. No edit moves a trim further than tolerance: a trim end on a surface pole keeps its uv, an end sent further is left, and a curve edit that would move further is discarded and only the vertex moves. A stack of slivers whose outer faces part by more than tolerance is not sewn across (neighbours_part). Each edge that moved records how far as its CadaclysmSolid.edge_tolerance(), as sewing records a gap; an end that could not move records how far it was left from the merged vertex.
A guard compares the result's health with this solid's. If it is worse — less closed, more free or non-manifold edges, or no faces left — healing retries with the face pass off; if that is still worse, this solid comes back as it was. guarded is set whenever the guard refused a fix. So a lone sliver sheet comes back as a face of two trims: its short ends merged, the sliver refused.
edges, faces and holes switch each kind of fix; a kind switched off is refused as toggled. tolerance null, NaN, infinite, zero or negative takes the default, 1e-4 times the diagonal; the report shows what was used. In the browser the reader module's Scene.healed returns the report only: heal the body through the blacksmith module's Solid.heal. A solid that cannot be read returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Returns a Dictionary {body, report}, report the HealReport Dictionary; an empty one on failure. The three kinds are the edges, faces and holes arguments; tolerance as health's.
CadaclysmSolid.edge_tolerance()
func edge_tolerance(edge: int) -> float
How far edge edge (a brep edge id, as a HealFix or FreeEdge names one) may lie off its curve: 0 for an exact edge, the distance healing or sewing moved it where that is recorded, null when no trim names the id (an edge healing removed). A solid that cannot be read returns null, false or an empty value (the reason in Cadaclysm.last_error()).
NAN for none: Godot has no null number. An id outside 0 to 4294967295 is refused (NAN, with the reason in Cadaclysm.last_error()).
CadaclysmSolid.recognize()
func recognize(tolerance: float = 0.0) -> Dictionary
This solid with its free-form surfaces and edge curves given their analytic kind, beside a RecognizeReport of what was taken and left, as a new CadaclysmSolid; this one is left as it was. A NURBS, revolved, extruded or swept surface that is a plane, cylinder, cone, sphere or torus within tolerance of every sample of its faces and every point of their edges becomes exactly that; an edge curve that is a line, circle or ellipse within it likewise, over the same stretch run the same way. So a file that stored its analytic faces as NURBS — a .3dm above all, and many STEP and SAT exports — comes back as it was made, and verbs that read a face's kind (a hole's axis, a fillet's radius) work on it.
Faces and edges keep their numbers, so a face or edge picked before is the same one after. The faces of one surface are taken together or not at all. A face given only by trims in its old surface's parameters (.3dm, IGES) is lifted to space edges first. Volume and area move by no more than the tolerance allows.
tolerance null, NaN, infinite, zero or negative takes the default, 1e-6 of the body's extent; the report shows what was used. Not the file's declared tolerance: at a STEP file's usual 0.01, a fillet's blend reads as a torus and the body's area moves by parts in a thousand. In the browser the reader module's Scene.recognized returns the report only: recognise the body through the blacksmith module's Solid.recognize. A solid that cannot be read returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Returns a Dictionary {body, report}, report the RecognizeReport Dictionary; an empty one on failure. tolerance defaults to 0, which, as any value not finite and positive, takes the library's default.
CadaclysmSolid.tolerances()
func tolerances() -> Dictionary
What this solid declares about its own precision, as Tolerances: read from its file, inherited through every verb from the loosest of its inputs, or set by CadaclysmSolid.with_tolerances(); none in a field nothing declared. A verb given no tolerance works at CadaclysmBlacksmith.effective_tolerance(), which takes it into account.
CadaclysmSolid.with_tolerances()
func with_tolerances(absolute: float = 0.0, angular: float = 0.0) -> CadaclysmSolid
A new solid: this one declaring absolute (a length) and angular (radians) instead of what it declared, its name, paint and marks kept. None or 0 declares nothing for that field; a negative or infinite value returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.vertex_tolerance()
func vertex_tolerance(point: Variant) -> float
How loose this solid's vertex at point is, where its producer said (an OCCT .brep records one per vertex): the tolerance of the nearest recorded vertex within its own tolerance of point. None where none is recorded there.
CadaclysmSolid.push_pull()
func push_pull(face: Variant, distance: float, tolerance: float = 0.05) -> CadaclysmSolid
Face face pushed out by distance along its outward normal — pulled in, negative — as a face extrude does it: the prism over it joined on (cut out) at tolerance, and the flush faces merged, so a box's top raised is one taller box of six faces rather than a box and a prism with every side wall split at the seam. A face on a cylinder, a cone, a sphere or a torus moves out along its normal instead, as a press-pull does: the surface a step out — a boss fatter, a bore or a countersink narrower, a dome fuller — with the flat faces beside it carried along in their own planes. Any other curved face is refused, as is a curved face with anything but a plane it can follow beside it, reaching a cone's apex, pushed to its axis or centre, off a plane beside it or run into another edge. A flat face keeps its own colour where it now lies.
Several faces push together, as a press-pull on a selection: each by its own rule, one after another in the order given, each found again after the pushes before it renumbered the faces — a box's top and a side pushed 5 is the box 5 taller and 5 wider, a boss's top and wall the boss taller and fatter. A face on the same curved surface as one before it, and joined to it, moved with that one and is not pushed twice. No faces, or a face an earlier push took away, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
face is a face index, or a list of them (an Array or a PackedInt32Array).
CadaclysmSolid.refillet()
func refillet(face: int, radius: float, tolerance: float = 1e-6) -> CadaclysmSolid
The round face belongs to — a fillet's bands, balls and rim bands joined to that face — made again at radius, as a press-pull on a fillet face: taken back to the sharp edges it replaced, and those rounded again, so the round is the one CadaclysmSolid.fillet() makes at that radius. Rounds of straight edges between planes (their ends square corners, mitres, balls, or a cylinder, cone or sphere the edge runs into — a D-cut shaft's top edge, a rib's into a boss) and of circular rims between a plane and a cylinder or cone (a boss's foot, a bore's mouth, a counterbore's step); a face that is not one, or a radius that does not fit, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.unfillet()
func unfillet(face: int) -> CadaclysmSolid
The round face belongs to taken off, the faces beside it made sharp again, meeting on the edges the round replaced — the delete of a fillet face. The same rounds as CadaclysmSolid.refillet().
CadaclysmSolid.rechamfer()
func rechamfer(face: int, distance: float, tolerance: float = 1e-6) -> CadaclysmSolid
The chamfer face belongs to — its bevels (flat between two planes, cones round rims) and the corner triangles joined to that face — cut again at distance, as a press-pull on a chamfer face: taken back to the sharp edges it cut, and those bevelled again, so the chamfer is the one CadaclysmSolid.chamfer() cuts at that distance. A flat bevel's ends may run into a cylinder, cone or sphere, as a round's may. A face that is not a chamfer's bevel, or a distance that does not fit, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.unchamfer()
func unchamfer(face: int) -> CadaclysmSolid
The chamfer face belongs to taken off, the faces beside it made sharp again — the delete of a chamfer face. The same chamfers as CadaclysmSolid.rechamfer().
CadaclysmSolid.face_round_radius()
func face_round_radius(face: int) -> float
The radius of the round face belongs to — one CadaclysmSolid.unfillet() can take back — or 0 where it is none: only the cylinders, spheres and tori a fillet made are asked. A face the solid does not have returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.face_chamfer_distance()
func face_chamfer_distance(face: int) -> float
The distance of the chamfer face belongs to — one CadaclysmSolid.unchamfer() can take back — or 0 where it is none: only the planes and cones a chamfer made are asked. A face the solid does not have returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.merge_flush()
func merge_flush() -> CadaclysmSolid
This solid with its flush faces merged: flat faces on one plane, facing one way and meeting along their edges — the seams CadaclysmSolid.join() leaves where two parts are flush — made one face, and the vertices left mid-way along a straight edge taken out.
CadaclysmSolid.split()
func split(tool: CadaclysmSolid, tolerance: float = 0.05) -> Array[CadaclysmSolid]
This solid split by tool into bodies — returned as a list: a closed tool gives the parts outside it, then the parts inside; a flat sheet (a CadaclysmSolid.face()) splits by the whole plane it lies on. Each connected part is a body of its own, so a U cut across both arms is three. The new faces are pieces of the tool's, the colours carried over. A tool that does not cross the solid, or a curved sheet, returns null, false or an empty value (the reason in Cadaclysm.last_error()). tolerance and progress as for CadaclysmSolid.join().
CadaclysmSolid.split_by_plane()
func split_by_plane(plane: Variant, tolerance: float = 0.05) -> Array[CadaclysmSolid]
This solid split by the plane through plane's origin, square to its z (a frame): the bodies in front of it first, then those behind.
CadaclysmSolid.split_by_profile()
func split_by_profile(profile: CadaclysmProfile, frame: Variant, tolerance: float = 0.05) -> Array[CadaclysmSolid]
This solid split by the closed CadaclysmProfile profile drawn on frame, pushed straight through it along the frame's z both ways — a split by a sketch profile: the bodies outside the profile first, then those inside. Where the plane lies along z does not matter, only the outline across it: a circle cores a sphere wherever it is drawn above it. The new faces are the profile's walls exactly. A profile that misses the solid, takes all of it or encloses nothing returns null, false or an empty value (the reason in Cadaclysm.last_error()). tolerance and progress as for CadaclysmSolid.join().
CadaclysmSolid.lumps()
func lumps() -> Array[CadaclysmSolid]
This solid's connected bodies, each a solid of its own — faces sharing an edge are one body — in the order of their first faces. One body comes back as itself; a boolean that leaves two parts gives two.
CadaclysmSolid.merge()
func merge(other: CadaclysmSolid, tolerance: float = 0.05) -> CadaclysmSolid
This solid and other as one body that keeps every piece — a union that keeps the inside pieces, as Rhino's MergeBreps: every face of both, split where they cross, the walls they share stored once. Its CadaclysmSolid.regions() are this solid less other, the two together and other less this one, those that are not empty; one solid inside the other gives the outer one with a void and the inner one, two solids apart give both. Faces keep the colours of the faces they are pieces of.
The body is non-manifold: where a wall between two cells meets the outside, an edge has three or four faces. The verbs that need a manifold solid — CadaclysmSolid.join(), CadaclysmSolid.cut(), CadaclysmSolid.common(), the splits and trims, CadaclysmSolid.fillet(), CadaclysmSolid.chamfer(), CadaclysmSolid.shell(), CadaclysmSolid.thicken(), CadaclysmSolid.mass() and the STEP writer — refuse it and name the way out: take each cell with CadaclysmSolid.region_solid().
Built exactly, on the exact boolean route: both solids closed, every face a plane, cylinder, cone, sphere or torus. A face of any other kind returns null, false or an empty value (the reason in Cadaclysm.last_error()), naming it; so do walls of the two lying on one another in part (two boxes sharing part of a side, equal solids) — a case the exact route does not take yet, refused in words, with no mesh fallback. tolerance (0.05 by default) is the resolution the sections are found to; progress as for CadaclysmSolid.join().
CadaclysmSolid.draft()
func draft(faces: Variant, plane: Variant, angle: float, tolerance: float = 0.0) -> CadaclysmSolid
Faces faces drafted to angle (radians) against the pull direction plane's z, about the neutral plane through plane's origin square to it — OCCT's BRepOffsetAPI_DraftAngle, Fusion's Draft. angle is each face's new draft angle, absolute, in (-pi/2, pi/2): asin(n . d), n the face's outward normal and d the pull, so it is positive where the face looks partly along the pull — an outer wall narrowing towards +z, a hole widening. A plane turns about the line where it crosses the neutral plane, which stays where it was; a cylinder along the pull becomes the cone through the circle it cuts there (a cone along the pull the same from its own circle). The faces beside a drafted one follow it, every vertex moving onto the drafted faces and the planes it lay on, a vertex in the neutral plane not at all; the faces keep their order, colours and marks. A face parallel to the neutral plane, a cylinder across the pull, a sphere, torus or free-form face, a curved neighbour not drafted with it, a hole through a drafted plane, a face that closes up at the angle asked, or a result that does not close returns null, false or an empty value (the reason in Cadaclysm.last_error()). tolerance and progress as for CadaclysmSolid.join().
CadaclysmSolid.draft_two_sided()
func draft_two_sided(faces: Variant, plane: Variant, above: float, below: float, tolerance: float = 0.0) -> CadaclysmSolid
Faces faces drafted both ways from the neutral plane plane — a parting line: above it (along its z) to above against +z, below it to below against -z, so for positive angles both halves narrow away from the plane; above == below is Fusion's symmetric draft. A face wholly on one side is drafted as CadaclysmSolid.draft() drafts it; otherwise the solid is split by the plane, each side drafted, and the halves joined back on their cut faces, the faces the plane cut in two made one again. The faces come back in the join's order, each keeping its colour, a drafted half its face's. What CadaclysmSolid.draft() refuses returns null, false or an empty value (the reason in Cadaclysm.last_error()) here too.
CadaclysmSolid.draft_angle_at()
func draft_angle_at(face: int, point: Variant, pull: Variant) -> CadaclysmDraftPoint
The point of face face nearest point and the draft angle there against the pull direction pull (normalised), as a CadaclysmDraftPoint — Rhino's BrepFace.DraftAnglePoint. The angle is CadaclysmSolid.draft()'s, asin(n . d): +pi/2 a top, 0 a wall along the pull, -pi/2 a bottom; a point on the face's boundary reads the face's own normal there, not the mean of the faces meeting. A face index out of range, a point not finite, or a pull zero or not finite returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.draft_analysis()
func draft_analysis(pull: Variant, threshold: float = 0.017453292519943295, tolerance: float = 0.0) -> Array[CadaclysmFaceDraft]
Every face's draft against pull (normalised), one CadaclysmFaceDraft per face in face order — Fusion's draft analysis. The body is meshed at tolerance (none: the effective one); each triangle's angle is read exactly at its centre and its area banded by threshold (radians, in [0, pi/2), 1 degree by default) into positive, negative and vertical; a triangle drafting either way casts a ray along the way it releases, and one that meets the body is undercut — a ledge under an overhang. A pull zero or not finite, a threshold out of range, or a negative tolerance returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.sheet_base()
static func sheet_base(profile: CadaclysmProfile, rule: CadaclysmSheetRule, frame: PackedFloat64Array = PackedFloat64Array(), tolerance: float = 0.0) -> CadaclysmSolid
The base flange: profile as a flat sheet under frame (none: the world's xy), its top in the frame's plane and the sheet the CadaclysmSheetRule's thickness below it — Fusion's Flange from a sketch, Inventor's Face. A rule out of range returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.sheet_contour()
static func sheet_contour(path: Variant, width: float, rule: CadaclysmSheetRule, frame: PackedFloat64Array = PackedFloat64Array(), tolerance: float = 0.0) -> CadaclysmSolid
A contour flange: the open path path (points in frame's plane, the sheet seen edge on) swept width along the frame's z, each corner a bend of the rule's radius. A path of fewer than two points, a corner too tight for the bend, or a width not positive returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.sheet_lofted_flange()
static func sheet_lofted_flange(a: Variant, b: Variant, rule: CadaclysmSheetRule, tolerance: float = 0.0) -> CadaclysmSolid
A lofted flange between the open polylines a and b (points, at least two each), the sheet's top face — Fusion's Lofted Flange, press-brake style: the strip between them is cut into facets (neighbours in one plane merged), every crease a bend of the rule's radius, so the part reads and unfolds like any other. Sample an arc into as many points as facets wanted (a square-to-round is a square's sides and a sampled circle). The sheet lies under the facets' normal, along a crossed with towards b: reverse both to put it on the other side. Each facet is cut back by its bends' set-backs and each bend zone ends square a little inside its facets, so the outline steps in at each end of a crease. Fewer than two points, a repeated point, a facet with no area, or a facet its bends' set-backs leave nothing of (fewer facets or a smaller radius) returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.sheet_flange()
func sheet_flange(edges: Variant, angle: float, length: float, rule: CadaclysmSheetRule, offsets: PackedFloat64Array = PackedFloat64Array(), tolerance: float = 0.0) -> CadaclysmSolid
Edge flanges on edges (edges of a broad face of a sheet body), each turned angle radians (> 0 up, towards the side the edge's face looks) and length high outside, bent at the rule's radius. offsets none for flanges the full length of their edges, else how far in each starts from its edge's two ends, the rule's bend relief cut there. Two flanges meeting at a corner are mitred with the rule's gap. An edge not on a broad face's rim, a body that is not sheet metal, an angle out of range or a length shorter than the bend returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.sheet_hem()
func sheet_hem(edges: Variant, kind: String, length: float, rule: CadaclysmSheetRule, gap: float = 0.0, angle: float = 0.0, tolerance: float = 0.0) -> CadaclysmSolid
Hems on edges: kind flat (the lip folded flat on the sheet), open (folded back with a gap), rolled (rolled round through angle, 0: 1.5 pi), teardrop, rope (curled round a rod gap across until it comes back down to the sheet) or double (folded twice and pressed flat, three layers); length the lip (a rope hem has none), gap the gap inside (0: the thickness). What CadaclysmSolid.sheet_flange() refuses returns null, false or an empty value (the reason in Cadaclysm.last_error()) here too.
CadaclysmSolid.sheet_fold()
func sheet_fold(face: int, line: Variant, angle: float, rule: CadaclysmSheetRule, tolerance: float = 0.0) -> CadaclysmSolid
A bend on the line through the two points line across the flat broad face face: the material on the line's left, seen from the face's outside, turned angle radians — Fusion's Bend. A face that is not a flat broad face, a line that does not cross it, or a fold through another bend returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.sheet_rip()
func sheet_rip(edges: Variant, gap: float = 0.0, tolerance: float = 0.0) -> CadaclysmSolid
Rips along edges (sharp edges between two walls of a shelled solid): a slot gap wide (0: a tenth of the wall) through the wall, so CadaclysmSolid.sheet_convert() can lay a closed box flat.
CadaclysmSolid.sheet_convert()
func sheet_convert(fixed_face: int, rule: CadaclysmSheetRule, tolerance: float = 0.0) -> CadaclysmSolid
A shelled solid of constant thickness made sheet metal from fixed_face: every sharp edge between two flat broad faces becomes a bend of the rule's radius, the outside kept — Fusion's Convert to Sheet Metal. A solid not of one thickness, or a closed loop of walls that needs a rip first, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.sheet_corner_relief()
func sheet_corner_relief(rule: CadaclysmSheetRule, tolerance: float = 0.0) -> CadaclysmSolid
The rule's corner relief (square, round or tear, its size) cut at every corner where two bend zones end close together.
CadaclysmSolid.sheet_rip_points()
func sheet_rip_points(face: int, a: Variant, b: Variant, gap: float = 0.0, tolerance: float = 0.0) -> CadaclysmSolid
A rip from point a to point b on the flat broad face face — Fusion's point-to-point rip: a slot gap wide (0: a tenth of the thickness) cut through that wall only. An end on the face's outline breaks through it; an end inside the face stops there, a slit. Works on any body of one thickness, folded or not. A face that is not a flat broad face, or a point off it, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.sheet_rip_face()
func sheet_rip_face(face: int, tolerance: float = 0.0) -> CadaclysmSolid
The wall under the broad face face (flat or a bend) removed through the thickness — Fusion's face rip: a closed box opened, a bend ripped out between its two walls. A face that is not a broad face, or a rip that leaves nothing, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.sheet_join()
func sheet_join(edge_a: Variant, edge_b: Variant, rule: CadaclysmSheetRule, tolerance: float = 0.0) -> CadaclysmSolid
Two walls joined by a bend of the rule's radius — Fusion's Join by Bend. edge_a and edge_b are outline edges where each wall's broad face meets its square end, parallel and of one extent: each wall runs on to the other's far face, which makes one sharp corner with the outer faces meeting on the mould line, and the corner is bent, both legs kept to that line. Walls in one plane facing each other are joined flat. Two parts are CadaclysmSolid.join()ed into one body first. Edges that are not wall ends, not parallel or of different extent, walls that overlap or lie parallel in two planes, or a rule thickness not the walls', returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.sheet_fillet()
func sheet_fillet(edges: Variant, radius: float, rule: CadaclysmSheetRule, tolerance: float = 0.0) -> CadaclysmSolid
Rounds of radius on thickness edges (straight edges across the sheet where two of its sides meet, at a corner of the outline, on a flat region) — Fusion's sheet-metal fillet. Each is a corner of the flat pattern: rounded there (cut on a convex corner, filled on a concave one) and the part folded again, so it stays sheet metal and CadaclysmSolid.flat_pattern() lays the round flat. An edge that is not a thickness edge, an edge on a bend, or a round that runs past the sides beside it returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.sheet_chamfer()
func sheet_chamfer(edges: Variant, distance: float, rule: CadaclysmSheetRule, tolerance: float = 0.0) -> CadaclysmSolid
Chamfers distance along both sides on thickness edges, laid into the flat pattern as CadaclysmSolid.sheet_fillet() lays its rounds. What it refuses returns null, false or an empty value (the reason in Cadaclysm.last_error()) here too.
CadaclysmSolid.is_sheet_metal()
func is_sheet_metal(tolerance: float = 0.0) -> bool
Whether the body reads as sheet metal: two broad sides of constant thickness, flat faces and cylindrical bends, side faces one thickness wide.
CadaclysmSolid.sheet_bend_faces()
func sheet_bend_faces(tolerance: float = 0.0) -> PackedInt64Array
The faces of every bend, two a bend (inner and outer). A body that is not sheet metal returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.sheet_info()
func sheet_info(fixed_face: int = -1, tolerance: float = 0.0) -> CadaclysmSheetInfo
The body read as sheet metal from fixed_face (none: its largest flat broad face), as a CadaclysmSheetInfo: its thickness, the face it is laid from, and every bend as a CadaclysmBendInfo. A body that is not sheet metal returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.flat_pattern()
func flat_pattern(fixed_face: int, rule: CadaclysmSheetRule, tolerance: float = 0.0) -> CadaclysmFlatPattern
The body unfolded from the flat broad face fixed_face under the rule, as a CadaclysmFlatPattern: every bend laid flat at its allowance |angle| (R + K T) — OCCT has no sheet metal; Fusion's and Inventor's Flat Pattern. A body that is not sheet metal, a face that is not a flat broad face, a rule thickness not the body's, or a flat that overlaps itself returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.fold_flat()
static func fold_flat(profile: CadaclysmProfile, bends: Array, rule: CadaclysmSheetRule, frame: PackedFloat64Array = PackedFloat64Array(), tolerance: float = 0.0) -> CadaclysmSolid
A flat outline folded: profile under frame (none: the world's xy), each of bends (a CadaclysmBend) a bend — a CadaclysmFlatPattern's outline and fold bends, edited and folded again. A bend line that does not cross the outline, or two bends crossing, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.unroll()
func unroll(faces: PackedInt64Array = PackedInt64Array(), points: PackedFloat64Array = PackedFloat64Array(), explode: bool = false, tolerance: float = 0.0) -> CadaclysmUnrolled
func unroll_with_curves(curves: Array, faces: PackedInt64Array = PackedInt64Array(), points: PackedFloat64Array = PackedFloat64Array(), explode: bool = false, tolerance: float = 0.0) -> CadaclysmUnrolled
Faces faces (none: all) laid flat in the xy plane, as an CadaclysmUnrolled — Rhino's Unroller. Planes, cylinders and cones unroll exactly, any other surface whose Gaussian curvature vanishes within tolerance by its own flattening. Faces sharing an edge stay joined unless joined they would overlap (or explode), the largest face placed first. curves follow onto the flat, in pieces where they cross a cut, and points to their spots. A face that is not developable is left out and reported, never stretched. A face out of range, or no developable face, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
unroll(faces, points, tolerance, explode) takes no curves; unroll_with_curves(faces, curves, points, tolerance, explode) carries CadaclysmNurbsCurves onto the flat as well.
CadaclysmSolid.squish()
func squish(faces: PackedInt64Array = PackedInt64Array(), points: PackedFloat64Array = PackedFloat64Array(), explode: bool = false, deformation: String = "free", preserve_boundary: bool = true, tolerance: float = 0.0) -> CadaclysmSquished
func squish_with_curves(curves: Array, faces: PackedInt64Array = PackedInt64Array(), points: PackedFloat64Array = PackedFloat64Array(), explode: bool = false, deformation: String = "free", preserve_boundary: bool = true, tolerance: float = 0.0) -> CadaclysmSquished
Faces faces (none: all) laid flat in the xy plane with the least distortion, developable or not, as a CadaclysmSquished — Rhino's Squisher, the companion to CadaclysmSolid.unroll(). Faces sharing an edge flatten together unless explode; a group whose faces are all developable is laid exactly as CadaclysmSolid.unroll() lays it, the others are meshed finely and relaxed (a conformal start, then an energy over each triangle's stretch). deformation reads from the flat to the shape, as Rhino's: "free", "stretch_mostly" and "stretch_only" (flat lengths at most their 3D lengths: the pattern stretches to cover the shape), "compress_mostly" and "compress_only" (at least); *only* holds in every triangle in every direction. preserve_boundary (on by default) keeps the outline's length. curves follow onto the flat (in pieces where they leave the faces), points to their spots. A face out of range, a bad deformation, or faces that close on themselves (a closed surface has no edge to open from) returns null, false or an empty value (the reason in Cadaclysm.last_error()).
squish(faces, points, explode, deformation, preserve_boundary, tolerance) takes no curves; squish_with_curves(curves, ...) carries CadaclysmNurbsCurves onto the flat as well.
CadaclysmSolid.regions()
func regions() -> Array[CadaclysmRegion]
The regions of space this solid's faces bound, as CadaclysmRegion values — Rhino's GetRegions, computed on demand from the faces' order round every edge. Region 0 is the infinite one, the outside; the finite ones follow in a fixed order, so the same body gives the same list. An ordinary solid has two (the outside, in front of every face, and the inside, behind them), a CadaclysmSolid.merge() one per cell, a solid with a cavity three (the cavity is a region of its own).
Each region lists its sides as CadaclysmFaceSide values: a face and its sense, +1 where the region is the side the face's normal points to, -1 the other — a solid's own inside is behind its faces, at -1. Its shells come outer boundary first, then one per void inside it. Faces that leave an edge the same way (tangent along it, to the second order) returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.region_solid()
func region_solid(region: int) -> CadaclysmSolid
Finite region region (an index into CadaclysmSolid.regions()) as a closed solid of its own — Rhino's BrepRegion.BoundaryBrep: the faces bounding it, each turned to point out of it, each keeping its colour. A CadaclysmSolid.merge()'s cells come out one at a time this way, ready for CadaclysmSolid.mass() and the booleans. A closed manifold unless the region touches itself along an edge. Region 0 (the infinite region) or a region past the count returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Finishing
CadaclysmSolid.edges
var edges: Array[CadaclysmEdge] # read-only
The solid's edges as CadaclysmEdge values — what CadaclysmSolid.fillet() and CadaclysmSolid.chamfer() take. Copied; safe to keep.
CadaclysmSolid.fillet()
func fillet(edges: Variant, radius: float, tolerance: float = 1e-6, radius_end: float = f64.NAN) -> CadaclysmSolid
Round the given edges (CadaclysmEdge values or their indices) with radius. Exact: the blend faces are cylinders, tori and NURBS, and the neighbours are trimmed back onto them. A spline edge — the crease between two faces on NURBS surfaces, running from one free edge of the shell to another, as between a fender patch and a door patch — is rounded by a ball rolled along it, the two faces cut back to where it touches them, in a call of its own (not with straight or circular edges); tolerance is then the fillet surface's fit. radius_end (spline edges only) runs the radius linearly from radius to it in arc length along the edge. A spline edge ending where other shared edges meet, a closed one, or a varying radius on a straight or circular edge returns null, false or an empty value (the reason in Cadaclysm.last_error()).
radius_end is NAN (the default) for none, after tolerance: solid.fillet(edges, 8.0, 1e-3, 20.0).
CadaclysmSolid.fillet_law()
func fillet_law(edges: Variant, law: Variant, tolerance: float = 1e-6) -> CadaclysmSolid
Round a chain of spline edges (CadaclysmEdge values or their indices) with the radius following a law: law is the radius at stations along the chain, each (share, radius) — the share of the chain's arc length from its start, 0 to 1 — run through smoothly by a monotone cubic, so the radius never swings past its stations, and held flat before the first station and after the last. [(0, 4), (1, 12)] grows from 4 at one end to 12 at the other, as a car's shoulder fillet does. The edges must run end to end into one open chain, each running on tangent into the next; the chain runs the way the first edge's curve does. Where the faces either side change from one edge to the next they must meet smooth along a seam through the vertex between, and the fillets meet on one shared end there. tolerance is the fillet surfaces' fit. Straight or circular edges, a branching or closed chain, or edges meeting at an angle returns null, false or an empty value (the reason in Cadaclysm.last_error()).
law is an Array of [share, radius] pairs or a PackedVector2Array.
CadaclysmSolid.chamfer()
func chamfer(edges: Variant, distance: float, tolerance: float = 1e-6) -> CadaclysmSolid
A flat bevel instead of a round: each edge cut back distance along both its faces.
CadaclysmSolid.shell()
func shell(thickness: float, open: PackedInt32Array = PackedInt32Array(), tolerance: float = 1e-6) -> CadaclysmSolid
Hollow the solid to walls thickness thick — inward for a positive thickness, outward (the solid becoming the cavity) for a negative one. The faces listed in open are removed so the hollow is reachable.
CadaclysmSolid.thicken()
func thicken(thickness: float, tolerance: float = 1e-6) -> CadaclysmSolid
A sheet made a solid thickness thick: its faces, their twins moved thickness along the faces' normals (against them for a negative thickness), and a wall round every open edge. Two faces of a folded sheet meet on their offsets' mitre; a closed sheet thickens to a hollow. Free-form (NURBS) faces offset by a fit held to tolerance. A thickness a face cannot take — a radius used up, a free-form offset folding over — returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.offset()
func offset(distance: float, tolerance: float = 0.0) -> CadaclysmSolid
This solid offset by distance: every face moved along its outward normal — outward for a positive distance, inward for a negative one — and the moved faces' new neighbours meeting at sharp joins, on their offsets' intersection (no rounded joins). A closed solid grows or shrinks to the solid its moved skin bounds; an open sheet moves to its twin, its rims left open. Each face keeps the colour, id and attributes of the face it was moved from, however far it moved; edges are matched by position. A face the offset uses up is gone, its neighbours meeting sharp. Free-form faces are fitted within tolerance (none: the solid's effective tolerance). A distance that is 0, NaN or infinite, a face that folds over, or a skin the offset leaves open returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.offset_face()
func offset_face(face: int, distance: float, tolerance: float = 0.0) -> CadaclysmSolid
Face face alone, as an open sheet moved distance along its outward normal (against it for a negative distance), still facing this solid's way, in the face's own colour: CadaclysmSolid.face_sheet() then CadaclysmSolid.offset(). A face closed on itself — a sphere's only face — gives a closed solid. tolerance as for CadaclysmSolid.offset(). A face this solid has not, a distance that is 0, NaN or infinite, or an offset that folds over returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Asking
CadaclysmSolid.face_kind()
func face_kind(face: int) -> String
A face's surface: plane, cylinder, cone, sphere, torus, nurbs, revolution, extrusion or other.
CadaclysmSolid.select_face()
func select_face(selector: Variant) -> int
The index of the face a Selector picks.
CadaclysmSolid.face_frame()
func face_frame(face: int) -> CadaclysmFrame
The frame on a face: origin at its centre, z its outward normal, x world X laid onto the face (world Y on a face facing close to X) — CadaclysmFrame.at()'s rule, so the top of a box gets the XY plane's axes. What CadaclysmWorkplane.workplane() moves onto.
CadaclysmSolid.face_ref()
func face_ref(face: int) -> PackedFloat64Array
A face by what it is, eight numbers: the surface's kind (plane 0, cylinder 1, cone 2, sphere 3, torus 4, NURBS 5, revolution 6, extrusion 7, sum 8), a point on the surface at the face's middle (x, y, z), the outward normal there (x, y, z), and the face's extent. What a feature made on a face keeps — a sketch on it, a shell's opening — so the face is found again with CadaclysmSolid.find_face() when the solid is rebuilt with its faces moved, split or renumbered. Take it before any move you apply to the solid, and look it up on the unmoved one.
CadaclysmSolid.find_face()
func find_face(face_ref: PackedFloat64Array, hint: int = -1, tolerance: float = 1e-3) -> int
The face a reference from CadaclysmSolid.face_ref() refers to: among the faces of that kind whose surface passes through the point, facing the same way, the one the point lies in — or, where it lies in none (the face shrank away, a hole opened under it), the one whose boundary comes nearest. hint is the index the face had, preferred among faces that fit equally well; tolerance how far the point may sit off a surface to still be on it. None where the face is gone.
CadaclysmSolid.bounds
var bounds: AABB # read-only
The axis-aligned box, at the same cost whatever the solid's size: its mesh at a thousandth of its own extent, in double, so the box is inside the exact one and short of it by at most that. Worked out once per solid, apart from the tessellation CadaclysmSolid.mesh() caches. CadaclysmSolid.bounds_at() is the box of the mesh at a tolerance you name.
CadaclysmSolid.bounds_at()
func bounds_at(tolerance: float) -> AABB
The bounds over the tessellation at tolerance — the same cache CadaclysmSolid.mesh() fills, so asking both costs one mesh.
CadaclysmSolid.bounds64
CadaclysmSolid.bounds in double precision: the axis-aligned bounds over the mesh's unnarrowed positions at tolerance (0.05 where the language defaults it) — exact far from the origin, where CadaclysmSolid.bounds's float32 mesh is not.
Godot's geometry is single precision; the Rust SDK it is built on has it.
CadaclysmSolid.leaked_edges()
func leaked_edges(tolerance: float = 0.05) -> int
How many mesh edges at tolerance are bound by anything other than two triangles: zero for a closed solid. A seam two solids share along a line does not count; a hole or a fold does.
CadaclysmSolid.unpaired_edges()
func unpaired_edges(tolerance: float = 0.05) -> int
How many mesh edges have triangle uses that do not cancel out: zero for a closed, consistently oriented solid. Unlike CadaclysmSolid.leaked_edges() this catches a fold — two triangles running the same way.
CadaclysmSolid.is_watertight()
func is_watertight(tolerance: float = 0.05) -> bool
Whether CadaclysmSolid.leaked_edges() is zero.
CadaclysmSolid.manifold
var manifold: Dictionary # read-only
Whether the faces make a manifold — every edge bordered by one face or two, the faces round every vertex one fan — and whether it is closed, as a Manifold. Read off the solid's topology, not a mesh, so it takes no tolerance; whether the faces all face out is CadaclysmSolid.unpaired_edges()'s question.
CadaclysmSolid.edge_beziers()
func edge_beziers(tolerance: float = f64.NAN) -> PackedFloat64Array
The edges as rational cubic Béziers, sixteen numbers each — x, y, z, w per control point, the point Cartesian and its weight beside it, the record a profile's Béziers use — what a viewer draws the edges by: exact where an edge's curve has a Bézier form (a line one Bézier, a circle quarter-turn conics, a spline its own pieces), flattened within tolerance where it has none (left out: the solid's effective tolerance). A tolerance negative or infinite returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.isocurve_beziers()
func isocurve_beziers(density: int = 4, tolerance: float = f64.NAN) -> PackedFloat64Array
The faces' isoparametric curves as Béziers, sixteen numbers each as CadaclysmSolid.edge_beziers() gives them: density interior lines each way on every curved face, clipped to the face, plus the lines at the ends of its parameter span; a flat face draws none. Exact where the surface has a closed form for the line (a cylinder's rings are circles), flattened within tolerance elsewhere.
CadaclysmSolid.face_iso_intervals()
func face_iso_intervals(face: int, along_u: bool, at: float) -> Array[PackedFloat64Array]
The intervals of the swept parameter along which face face's isocurve lies inside its trims, as Rhino's TrimAwareIsoIntervals, ascending, as (start, end) pairs: along u at v = at when along_u, else along v at u = at. CadaclysmNurbsCurve.face_isocurves() gives the pieces as curves. A face past the end or an at not finite returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.mass()
func mass(accuracy: float = 0.0) -> Dictionary
What this solid measures, per unit density, as a Mass: area, volume, centroid, the inertia tensor about the centroid and its principal moments and axes — each figure beside a bound on its own error. Measured on the exact surfaces, refined until every error is under accuracy (a share of the figure) or the refinement gives up, which Mass.accuracy_met reports; the values are honest either way, they are simply less certain, and the errors say by how much. Volume, centroid and inertia mean something only where the body is closed — Mass.closed — and a body whose faces all point inward is measured as if they did not, which Mass.inverted says. An accuracy not positive and finite returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.oriented_box()
func oriented_box(accuracy: float = 0.0) -> CadaclysmOrientedBox
This closed solid's box on its principal axes, as an CadaclysmOrientedBox. The axes are the inertia's, so the box is tight along a clear long direction but not the minimal box in general; where two moments are equal (a cube, a cylinder about its axis) any axes in that plane are as principal as the others, so which come back is a free choice. The half-extents are grown by the tolerance the measurement settled on, so they hold the body and may exceed its own extent by about that much. It costs as much as CadaclysmSolid.mass() at the same accuracy, because the axes come from the same inertia: tens of seconds at 1e-7 on a free-form body read from a file. accuracy is relative, and 0 or less asks for the box's own default, 1e-5 — not measure.default_accuracy — because a finer one buys little box: the half-extents are grown by the diagonal times the larger of accuracy and a sixteenth of the integration's tolerance, which starts at 5e-4 of the diagonal, so a body that settles at once (planes, cylinders, cones) is grown by about 3.1e-5 of its diagonal however fine the accuracy. A coarser accuracy (1e-3, say) is the fast route. An open body has no oriented box, and an accuracy that is NaN or infinite returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.edge_length()
func edge_length(edge: int, accuracy: float = 0.0) -> CadaclysmLength
The length of one edge over its own range, as a CadaclysmLength: edge is the index CadaclysmSolid.edges uses (Python also takes the CadaclysmEdge itself), and accuracy the relative accuracy, 0 asking for measure.default_accuracy. An edge past the end, or one with no curve to measure, returns null, false or an empty value (the reason in Cadaclysm.last_error()). A body whose trims are 2D-only (Rhino .3dm, IGES entity 144) has no fillet-table edges at all, so this cannot be asked of it.
CadaclysmSolid.edge_point_at_length()
func edge_point_at_length(edge: int, s: float, accuracy: float = 0.0) -> CadaclysmAt
The point at arc length s along one edge, as an CadaclysmAt: s is absolute, measured from the start of the edge's own range (the t0 of its CadaclysmEdge.curve), and lies in [0, length] — past either end by no more than the length's own error is that end, further returns null, false or an empty value (the reason in Cadaclysm.last_error()). edge is the index CadaclysmSolid.edges uses (Python also takes the CadaclysmEdge itself); accuracy is relative, 0 or less asking for measure.default_accuracy. The sample's segment is empty on an edge. An edge past the end or with no exact curve, or an accuracy NaN, infinite or 1 or more, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.edge_divide_by_count()
func edge_divide_by_count(edge: int, n: int, accuracy: float = 0.0) -> Array[CadaclysmAt]
One edge in n pieces of equal arc length, as a list of CadaclysmAt: an open edge gives n + 1 samples from its start to its end, a closed one (its range the curve's whole closed loop: a whole circle or ellipse, a closed spline's whole domain) n, never its start again. The first sample is exactly the range's start and an open edge's last exactly its end. n is 1 to 1,000,000; accuracy as CadaclysmSolid.edge_point_at_length(), and so are the refusals.
CadaclysmSolid.edge_divide_by_length()
func edge_divide_by_length(edge: int, step: float, accuracy: float = 0.0) -> Array[CadaclysmAt]
Samples of one edge every step of arc length from its start, as a list of CadaclysmAt. The last piece is whatever is left over, kept short: an open edge's end is a sample only where a step lands on it (to within the length's error), and a closed edge never repeats its start. A step longer than the edge gives the start alone. step is positive and finite and may give at most 999,999 steps; accuracy as CadaclysmSolid.edge_point_at_length(), and so are the refusals.
CadaclysmSolid.loft_curves()
static func loft_curves(sections: Array, degree: int = 3, loose: bool = false, closed: bool = false) -> CadaclysmSolid
A sheet lofted through sections (CadaclysmNurbsCurves): one face on one NURBS surface whose u runs along the sections and v across them, degree across them (lowered to what the sections allow). loose=True shapes it by the sections instead — through the first and last only, smoother between; closed=True makes it periodic across them, the last section back to the first. Fewer than two sections (three closed) returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.sweep_rail()
static func sweep_rail(rail: CadaclysmNurbsCurve, sections: Array, frame: String = "rmf", up: PackedFloat64Array = PackedFloat64Array(), tolerance: float = 1e-3) -> CadaclysmSolid
A sheet of sections swept along rail: each section carried by the rail's frame from the rail point nearest its centre, the sections between blended by their place along the rail. frame="rmf" turns the sections no more than the rail makes them (rotation-minimising); "fixed" keeps up upright, as a sweep along a car's side does. Fitted through enough stations to lie within tolerance of that definition; CadaclysmSolid.sheet_error says how close it came.
up is a PackedFloat64Array, empty (the default) for none.
CadaclysmSolid.sweep_two_rails()
static func sweep_two_rails(rail_a: CadaclysmNurbsCurve, rail_b: CadaclysmNurbsCurve, sections: Array, tolerance: float = 1e-3) -> CadaclysmSolid
A sheet of sections swept between two rails: each section's first end on rail_a and its last on rail_b, carried by the rotation and uniform scale that keep them there, the rails matched by arc length (so a section spreads as the rails do). A section whose ends are not on the rails returns null, false or an empty value (the reason in Cadaclysm.last_error()). Fitted within tolerance (CadaclysmSolid.sheet_error).
CadaclysmSolid.edge_surface()
static func edge_surface(curves: Array, tolerance: float = 1e-3) -> CadaclysmSolid
The Coons sheet of 2, 3 or 4 boundary curves meeting end to end within tolerance, given in order round the boundary (each either way round): three leave the fourth side a point, two give the ruled sheet between them. Exact for non-rational boundaries; rational ones (arcs) are fitted first, and CadaclysmSolid.sheet_error is that fit's error. Curves that do not meet returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.network_surface()
static func network_surface(u_curves: Array, v_curves: Array, tolerance: float = 1e-3) -> CadaclysmSolid
The Gordon sheet of a curve network: u_curves in order across one way, v_curves across the other, every one of the first crossing every one of the second within tolerance. The curves are re-fitted so their crossings share parameters, then blended; CadaclysmSolid.sheet_error is the largest distance from the sheet to the curves given. A pair that does not cross returns null, false or an empty value (the reason in Cadaclysm.last_error()), naming both.
CadaclysmSolid.continuity()
func continuity(side: String, other: CadaclysmSolid, other_side: String, face: int = 0, other_face: int = 0, samples: int = 64) -> CadaclysmContinuity
How well this solid's face face meets other's face other_face along their sides — a side is "u0", "u1", "v0" or "v1", a boundary isocurve of the face's NURBS surface — as a CadaclysmContinuity: the largest gap between the sides (G0), the largest angle between their normals (G1), the largest difference of curvature across the edge (G2), each with where it is, from samples points along the first side. A face that is not NURBS, or a side that is not one of the four, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.edge_continuity()
func edge_continuity(edge: Variant, samples: int = 64) -> CadaclysmContinuity
How well the two faces of edge edge (an CadaclysmEdge or its index) meet along it, as a CadaclysmContinuity: samples points along the edge, each projected onto both faces, and the largest gap between the two (G0), angle between the faces' normals (G1; each normal the way its face faces, so a square crease reads pi/2) and difference of their normal curvatures across the edge (G2), each with where it is. Any two faces of one body, of any kind of surface — where CadaclysmSolid.continuity() compares two NURBS faces' sides. A test fails a design on these: a G1 seam reads an angle near 0, a G2 one a curvature near 0 too. An edge bounding one face, or three, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.faired()
func faired(tolerance: float = 1e-3, degree: int = 3, controls: PackedInt64Array = PackedInt64Array(), keep: PackedInt64Array = PackedInt64Array(), no_inflection: String = "", face: int = 0) -> CadaclysmSolid
Face face faired, as a sheet of its own: the smoothest surface within tolerance of its NURBS surface — least squares plus its third derivatives squared, what a zebra's ripple costs, weighed as heavily as the tolerance allows — so a sheet lofted through traced sections comes back calm between them. controls none fairs on the face's own net, its degree raised to degree (3 to 7) and its spans split to a dozen each way at least, keeping a kept side exactly; (n_u, n_v) fairs on a uniform net that size, its kept sides within the tolerance. keep says what each side keeps, one level for all four or one per side ("u0", "u1", "v0", "v1"): none free to move, 0 its position, 1 the tangent plane across it, 2 its curvature too — what CadaclysmSolid.matched() gave it. no_inflection "u", "v" or "uv" holds the isocurves along those directions from turning their curvature over. CadaclysmSolid.sheet_error is the largest distance between the two surfaces. A rational face, a degree outside 3 to 7, or a tolerance no such fair is within returns null, false or an empty value (the reason in Cadaclysm.last_error()), the last with the nearest distance found.
controls is empty or [n_u, n_v]; keep is empty (every side at 2), one level, or four in side order with -1 for free; no_inflection is "" for none. Returns null on refusal.
CadaclysmSolid.curvature_turns()
func curvature_turns(face: int = 0, samples: int = 32) -> CadaclysmCurvatureTurns
Where face face's Gaussian and mean curvature change sign, on a grid of samples steps each way over its surface (8 at fewest), as a CadaclysmCurvatureTurns: how many separate areas of each sign, and the points between opposite signs. A dome or a saddle reads one area and no turn; a sheet whose sections wobble reads several — the surface's CadaclysmNurbsCurve.inflections(). A face index out of range returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.highlight_kink()
func highlight_kink(edge: Variant, samples: int = 64) -> CadaclysmHighlightKink
The worst kink of the highlight lines crossing edge edge (an CadaclysmEdge or its index), at samples points along it, as a CadaclysmHighlightKink: the lines of straight light tubes a body's size away from the surface, every tube direction tried. They run on through an edge where the two faces' curvatures agree (G2) and kink where it jumps — a fillet's seam beside a flat face. Beside CadaclysmSolid.edge_continuity()'s curvature jump, this is the number a zebra shows. An edge bounding one face, or three, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.face_point()
func face_point(face: int, p: Variant, tolerance: float = f64.NAN) -> CadaclysmFacePoint
Where point p lies against face face, as a CadaclysmFacePoint: its nearest point of the face (exact, inside the trims or on their boundary) and where — inside, on the boundary (on an edge or a vertex of the face, or within tolerance of one) or off (farther than tolerance). Fusion's isPointOnFace is "not off"; Rhino's IsPointOnFace the same three. tolerance none (or 0) is the solid's CadaclysmBlacksmith.effective_tolerance(). A face out of range, a point not finite or a tolerance negative or infinite returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.face_inner_point()
func face_inner_point(face: int) -> CadaclysmFacePoint
A point strictly inside face face's trims, on its surface, as a CadaclysmFacePoint (inside, distance 0) — Fusion's pointOnFace. A face out of range, or one where no point inside is found, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.edge_point()
func edge_point(edge: Variant, p: Variant, tolerance: float = f64.NAN) -> CadaclysmEdgePoint
The nearest point to p of edge edge (an CadaclysmEdge or its index) on its own curve over its range, as an CadaclysmEdgePoint: the point, the curve's parameter t there (as CadaclysmSolid.edge_closest_point()'s) and on where it is within tolerance (none: the solid's CadaclysmBlacksmith.effective_tolerance()). An edge out of range, a point not finite or a tolerance negative or infinite returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.edge_inner_point()
func edge_inner_point(edge: Variant) -> CadaclysmEdgePoint
A point on edge edge: its curve at the middle of its range (a whole circle half a turn from its start), as an CadaclysmEdgePoint — Fusion's pointOnEdge. An edge out of range returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.face_size()
func face_size(face: int) -> PackedFloat64Array
The width and height of the rectangle face face would flatten to — Rhino's GetSurfaceSize: over the uv box its trims span, the longest of five u-isocurves and the longest of five v-isocurves. A face out of range returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.edge_convexity()
func edge_convexity(edge: Variant, angular_tolerance: float = f64.NAN, samples: int = 16) -> CadaclysmEdgeConvexity
How edge edge's two faces meet along it, at samples points (16 at fewest), as an CadaclysmEdgeConvexity: smooth (within angular_tolerance of tangent everywhere), convex (a ridge), concave (a valley), mixed (both along it) or open (one face, or three and more), with the smallest and largest signed turn between the faces' normals. angular_tolerance none (or 0) is the angle the solid declares, else the option tolerance.angular (see CadaclysmBlacksmith.set_option()). An edge out of range, or an angular tolerance negative, infinite or not below a right angle, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.edges_convexity()
func edges_convexity(angular_tolerance: float = f64.NAN) -> PackedStringArray
Every edge's convexity kind (as CadaclysmSolid.edge_convexity()'s, at 16 samples), in the order of CadaclysmSolid.edges.
CadaclysmSolid.concave_edges()
func concave_edges(angular_tolerance: float = f64.NAN) -> PackedInt64Array
The indices of the edges whose faces meet concave all along — Fusion's concaveEdges.
CadaclysmSolid.convex_edges()
func convex_edges(angular_tolerance: float = f64.NAN) -> PackedInt64Array
The indices of the edges whose faces meet convex all along — Fusion's convexEdges.
CadaclysmSolid.tangent_faces()
func tangent_faces(face: int, angular_tolerance: float = f64.NAN) -> PackedInt64Array
Face face and every face reached from it across edges whose faces meet smoothly (CadaclysmSolid.edge_convexity() smooth at angular_tolerance): breadth first, the face first, then each face's new neighbours ascending — Fusion's tangentiallyConnectedFaces. A face out of range returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.tangent_edges()
func tangent_edges(edge: Variant, angular_tolerance: float = f64.NAN) -> PackedInt64Array
Edge edge and every edge reached from it through vertices where two edges' curves run on with the same tangent, in the order found (the edge first) — Fusion's tangentiallyConnectedEdges. An edge out of range returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.tangent_face_groups()
func tangent_face_groups(angular_tolerance: float = f64.NAN) -> Array[PackedInt64Array]
The faces in groups joined smoothly (as CadaclysmSolid.tangent_faces()), each group's faces ascending, the groups in the order of their lowest face — Rhino's GetTangentConnectedComponents, as face groups.
CadaclysmSolid.angle_to()
func angle_to(kind: String, index: Variant, other: CadaclysmSolid, other_kind: String, other_index: Variant) -> CadaclysmAngle
The angle between this solid's face or edge index and other's (other may be this solid), as an CadaclysmAngle: a planar face is read as its plane, a cylinder's, cone's or revolved face as its axis, a straight edge as its line, a circular edge as its circle's plane — Fusion's measureAngle. Two planes read the angle between their outward normals (0 to pi), two lines between their directions (0 to pi), a line and a plane the line's angle to the plane (0 to pi/2). Any other face or edge, or an index out of range, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.face_minimum_radius()
func face_minimum_radius(face: int, samples: int = 16) -> CadaclysmMinimumRadius
Face face's smallest radius of curvature, 1 / max(|k1|, |k2|), as a CadaclysmMinimumRadius: a plane infinite, a cylinder or a sphere its radius, a cone and a torus in closed form over the face's trims, any other face on a grid of samples steps each way (16 at fewest) polished at its tightest — Fusion's MinimumRadiusAnalyses. A face out of range returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.matched()
func matched(side: String, other: CadaclysmSolid, other_side: String, level: int = 2, face: int = 0, other_face: int = 0) -> CadaclysmSolid
Face face as a sheet of its own, its side side bent to meet other's other_side at Glevel: 0 onto the other side, 1 into its tangent plane, 2 with its curvature too. The opposite side stays where it was; the face is refined across the edge first if it has too few rows. Both faces non-rational NURBS: a rational one, or a level outside 0 to 2, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.fillet_surfaces()
static func fillet_surfaces(a: CadaclysmSolid, b: CadaclysmSolid, radius: float, radius_end: float = f64.NAN, flip_a: bool = false, flip_b: bool = false, tolerance: float = 1e-3, face_a: int = 0, face_b: int = 0) -> Variant
The rolling-ball fillet between a's face face_a and b's face face_b — their whole NURBS surfaces — as (fillet, rail_a, rail_b): the fillet sheet (its CadaclysmSolid.sheet_error set) and the CadaclysmNurbsCurves the ball touches each face along, to trim the faces back with CadaclysmSolid.trim_by_curve() and join the three with CadaclysmSolid.join_sheets(). The ball sits on the side each face's normal points to (flip_a, flip_b turn it to the other side); its radius is radius, or runs linearly from radius at the fillet's first end to radius_end at its last. A radius not positive, or sides where the ball cannot touch both faces, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Returns an Array [sheet, rail_a, rail_b], or null with the reason in Cadaclysm.last_error(); radius_end is NAN (the default) for none.
CadaclysmSolid.blend_sides()
static func blend_sides(a: CadaclysmSolid, side_a: String, b: CadaclysmSolid, side_b: String, level: int = 2, bulge: float = 1.0, face_a: int = 0, face_b: int = 0) -> CadaclysmSolid
A sheet spanning from a's side side_a to b's side side_b, meeting each at Glevel (1 a cubic across, 2 a quintic, matching curvature too); bulge scales how far it leaves each edge along its neighbour's tangent. Both faces non-rational NURBS.
CadaclysmSolid.n_sided_patch()
static func n_sided_patch(boundaries: Array, bulge: float = 1.0, tolerance: float = 0.01) -> CadaclysmSolid
The sheet filling a hole of three or more sides — where several character lines meet, which four-sided patches cannot close: N four-sided NURBS faces round a central point, one per corner, meeting each other at G1 or G2. Each of boundaries, in order round the hole and either way round, is a sheet's side met at G2, (sheet, side); (sheet, side, level) with level 0, 1 or 2; a dict with sheet, side and any of level, face and range ((from, to) of the side's parameter: (0, 1) the whole side, (1, 0) the whole side backwards); or a CadaclysmNurbsCurve, met at G0. A side is "u0", "u1", "v0" or "v1". The boundaries must meet end to end within tolerance; bulge scales how far the patch leaves each neighbour along its own tangent. Face i meets boundary i's second half along its "v0" side and boundary i + 1's first half along its "u1", so CadaclysmSolid.continuity() measures each neighbour; CadaclysmSolid.patch_report holds the worst of them. It joins its neighbours with CadaclysmSolid.join_sheets(). Fewer than three boundaries, ends that do not meet, two boundaries running on tangent through a corner, or a rational boundary returns null, false or an empty value (the reason in Cadaclysm.last_error()).
A boundary is a CadaclysmNurbsCurve, an Array [sheet, side] or [sheet, side, level], or a Dictionary with sheet, side and any of level, face and range ([from, to]).
CadaclysmSolid.patch_report
var patch_report: Variant # read-only
On a sheet from CadaclysmSolid.n_sided_patch(), the CadaclysmPatchReport of how well it meets; null on every other solid.
CadaclysmSolid.sheet_error
var sheet_error: Variant # read-only
On a sheet from CadaclysmSolid.sweep_rail(), CadaclysmSolid.sweep_two_rails(), CadaclysmSolid.edge_surface() or CadaclysmSolid.network_surface(), how far it came from its definition; null on every other solid.
CadaclysmSolid.contains()
func contains(point: Variant, tolerance: float = 0.05) -> String
Where point is relative to this closed solid: inside, outside, or on, within tolerance of its boundary — absolute, in model units (0.05 by default). The body is meshed on every call; for more than a few points build a CadaclysmSolid.classifier() once. An open body, a point not finite, or a tolerance not positive and finite returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.classifier()
func classifier(tolerance: float = 0.05) -> CadaclysmClassifier
A CadaclysmClassifier for this closed solid at tolerance — absolute, in model units (0.05 by default): the body meshed once, then asked point after point. It keeps its own reference to the body, so it goes on answering after this solid is closed. An open body, or a tolerance not positive and finite, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.closest()
func closest(other: CadaclysmSolid, tolerance: float = 0.05) -> CadaclysmClosest
The closest points between this solid's boundary and other's, to tolerance — absolute, in model units (0.05 by default) — as a CadaclysmClosest; this solid is side a. Boundaries are measured, not volumes: a solid wholly inside another is the gap between their skins, not 0, and boundaries that cross are 0 apart (ask CadaclysmSolid.contains() for containment). progress, where the wrapper takes one, hears "meshing", "pruning" and "refining"; in the browser it is never called. A tolerance not positive and finite, or a solid with no faces, returns null, false or an empty value (the reason in Cadaclysm.last_error()). Whether two parts overlap, touch or lie within a clearance of each other is CadaclysmBlacksmith.clash()'s question, asked of a whole set.
CadaclysmSolid.closest_point()
func closest_point(p: Variant, max_distance: float = f64.NAN, tolerance: float = f64.NAN) -> CadaclysmPointFoot
The nearest point of this solid's boundary to p, as a CadaclysmPointFoot, or null where it lies beyond max_distance (Rhino's maximumDistance). A point inside a closed body is answered by its nearest boundary point, not 0. max_distance none, NaN or infinite is no limit; a point a rounding error past it is not beyond, so 0 finds a point that lies on the body. tolerance — absolute, in model units — is unset when none, 0 or NaN, and the tolerance policy then resolves it to the solid's effective tolerance; it sizes the mesh search only: every face within reach is refined exactly, and where a nearer candidate fails to refine the mesh's answer comes back with refined false, within [d - 2/3 tolerance, d + tolerance] of the true distance d. The body is meshed on every call; for more than a few points build a CadaclysmSolid.projector() once. A point not finite, a negative max_distance, a negative or infinite tolerance, or a body that meshes to nothing returns null, false or an empty value (the reason in Cadaclysm.last_error()).
max_distance and tolerance default to NaN: no limit, unset. GDScript has no exceptions: null beyond max_distance leaves Cadaclysm.last_error() empty, and a refusal is null with the reason there.
CadaclysmSolid.projector()
func projector(tolerance: float = f64.NAN) -> CadaclysmProjector
A CadaclysmProjector for this solid at tolerance (none, 0 or NaN is unset, which the tolerance policy resolves to the solid's effective tolerance): the body meshed once, then asked CadaclysmProjector.closest_point() point after point, the same answers as CadaclysmSolid.closest_point() — a refined false answer within [d - 2/3 tolerance, d + tolerance] of the true distance d. It keeps its own reference to the body, so it goes on answering after this solid is closed. Open bodies and sheets are accepted. A negative or infinite tolerance, or a body that meshes to nothing, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.curve_closest_points()
func curve_closest_points(curve: CadaclysmNurbsCurve, max_distance: float = f64.NAN, tolerance: float = f64.NAN) -> CadaclysmCurveBodyFoot
The nearest points of curve and this solid's boundary, as a CadaclysmCurveBodyFoot, or null where the body lies beyond max_distance (none, NaN or infinite: no limit). Where the curve passes through the boundary the answer is a crossing, distance exactly 0, at the earliest crossing in t. tolerance — absolute, in model units; none, 0 or NaN is unset, which the tolerance policy resolves to the solid's effective tolerance — sizes the march along the curve and the mesh search: a refined false answer is within [d - 2/3 tolerance, d + tolerance] of the true distance d. The body is meshed on every call; for more than a few curves build a CadaclysmSolid.projector() once and ask CadaclysmProjector.curve_closest_points(). A negative max_distance, a negative or infinite tolerance, a body that meshes to nothing, or a curve too long for the tolerance returns null, false or an empty value (the reason in Cadaclysm.last_error()).
max_distance defaults to NaN, no limit; where the call takes a tolerance it defaults to NaN too, the model's policy. null beyond it leaves Cadaclysm.last_error() empty; a refusal is null with the reason there.
CadaclysmSolid.triangle_mesh()
func triangle_mesh(tolerance: float = f64.NAN) -> CadaclysmTriangleMesh
This solid's measuring tessellation as a CadaclysmTriangleMesh: the mesh the measuring queries search, within a third of tolerance of the surface — finer than the display mesh CadaclysmSolid.mesh() gives at the same tolerance. Answers against it are exact for the mesh, not for the body. tolerance — absolute, in model units; none, 0 or NaN is unset, which the tolerance policy resolves to the solid's effective tolerance. The mesh is a copy: it answers on after this solid is closed. A negative or infinite tolerance, or a body that meshes to nothing, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
max_distance defaults to NaN, no limit; where the call takes a tolerance it defaults to NaN too, the model's policy. null beyond it leaves Cadaclysm.last_error() empty; a refusal is null with the reason there.
CadaclysmSolid.face_surface()
func face_surface(face: int) -> CadaclysmNurbsSurface
Face face's surface (its row in the face table), its trims ignored, as an exact CadaclysmNurbsSurface: a NURBS face as it is (clamped if it came unclamped); a cylinder, cone, sphere or torus in its exact rational form over a parameter range that covers the face (never smaller, but for a rare holed tube face); a plane as the bilinear patch over the rectangle its trims span. (u, v) are the NURBS's own parameters. The surface is a copy: it answers on after this solid is closed. A face out of range or a surface with no exact NURBS form returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.face_closest_point()
func face_closest_point(face: int, p: Variant) -> CadaclysmPointFoot
The nearest point to p of face face alone, inside its trims or on its boundary, as a CadaclysmPointFoot: exact, with no mesh, so always refined. A foot on the face's boundary names the edge or vertex it lies on. A face past the end (face_closest_point: face 99 of 6), a point not finite, or a face that gives no point returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.edge_closest_point()
func edge_closest_point(edge: int, p: Variant) -> Variant
The nearest point to p of one edge, on its own curve over its range: (t, point, distance), t the curve's parameter as CadaclysmEdge.curve and CadaclysmSolid.edge_point_at_length() use it. edge is the index CadaclysmSolid.edges uses — a CadaclysmPointFoot's edge (Python also takes the CadaclysmEdge itself). Exact, with no mesh. An edge past the end, one with no exact curve, or a point not finite returns null, false or an empty value (the reason in Cadaclysm.last_error()).
A Dictionary {t, point, raw_point, distance} — point a Vector3 of floats, raw_point its three doubles — or null on a refusal, the reason in Cadaclysm.last_error().
CadaclysmSolid.thickness_at_face()
func thickness_at_face(face: int, at: Variant, maximum: float, tolerance: float = 0.01) -> CadaclysmFaceThickness
How thick this solid's walls are at face face, as a CadaclysmFaceThickness, on a CadaclysmThicknessGauge of this solid alone built at tolerance (0.01 by default), asked CadaclysmThicknessGauge.thickness_at_face() once and freed: at at's foot on the face, or with no at over the face's vertices. maximum has no default. null where nothing on the face reads within maximum, or at's foot lies off the face. A face past the end, an at not finite, maximum not positive and finite, or a tolerance not positive and finite returns null, false or an empty value (the reason in Cadaclysm.last_error()).
thickness_at_face(face, at, maximum, tolerance): at and maximum are required, at first (null for none), tolerance defaults to 0.01.
CadaclysmSolid.bounds_box()
func bounds_box(tolerance: float = 0.05) -> CadaclysmBox
This solid's CadaclysmBox at tolerance (0.05 by default): its boolean mesh, padded by twice that — the broad phase's own bound, cheaper to move and to test against another than the solid itself. CadaclysmCollider builds one of these per part at construction. A tolerance not positive and finite, or a solid that meshes to nothing, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.face_tree()
func face_tree() -> CadaclysmRTree
An CadaclysmRTree over this solid's faces: one entry per face, its id the face index the other face calls take, its box holding the face — the box the boolean's broad phase pairs faces by (an analytic face's exact bound, another face's boolean mesh padded), grown by a thousandth of the solid's extent. Ask it which faces a box meets, which a ray passes, or which are near a point, then test those faces themselves. A solid with no faces gives an empty tree; a face that cannot be boxed returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Naming
CadaclysmSolid.named()
func named(name: String) -> CadaclysmSolid
This solid, named name. The name rides through an operation with exactly one source solid (place, translate, rotate, mirror, scaled, coloured, edges_coloured, fillet, chamfer, shell, thicken, face_sheet, drop_faces, lump, trim, split_by_plane, split_by_profile, push_pull, and so on) and is dropped by one with two or more sources (join, cut, common, split_sheet, split) and by a fresh primitive or sweep. It is what CadaclysmAssembly.place() defaults a placement's own name to, and the product name a lone named solid gets written into STEP (CadaclysmSolid.step()/CadaclysmSolid.step_text() — SAT and OCCT .brep have no product name to set). An empty name returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.name
var name: String # read-only
This solid's name, or none, as CadaclysmSolid.named() set it, kept or dropped by whatever built this solid.
"" for a solid with no name — Godot has no null string; CadaclysmSolid.closed tells that apart from a closed solid, which reads the same.
Material and outside style
CadaclysmSolid.with_material()
func with_material(material: String) -> CadaclysmSolid
This solid made of material — a name, written into STEP as the product's MATERIAL_DESIGNATION. Kept by every operation as the solid's colour is: a move keeps it, and a boolean's result is made of its first solid's. Writing it moves CadaclysmSolid.step()'s default schema to AP242; a named schema without the entity writes the solid without it, as it does a colour. A reader takes it back as the node's Material property. A blank material returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.material
var material: String # read-only
What this solid is made of, or none, as CadaclysmSolid.with_material() set it.
"" for a solid made of nothing named — Godot has no null string.
CadaclysmSolid.style()
func style(location: String, identification: String) -> CadaclysmSolid
This solid drawn in a style defined outside the file: identification the style's name in the library at location — a MaterialX or MDL file and a material in it, say. Either may be left out, not both. Written into STEP as an EXTERNALLY_DEFINED_STYLE beside the solid's colour, which a reader without the library draws instead (AP242 or AP214: the default schema moves to AP242); a reader takes it back as the node's ExternalStyle.Location and ExternalStyle.Identification properties. Kept by operations as CadaclysmSolid.with_material()'s material is. A style naming neither returns null, false or an empty value (the reason in Cadaclysm.last_error()).
styled(location, identification): both required, "" leaving one out.
CadaclysmSolid.style_location
var style_location: String # read-only
Where this solid's outside style lives (CadaclysmSolid.style()'s location), or none.
"" where there is none.
CadaclysmSolid.style_identification
var style_identification: String # read-only
This solid's outside style's name in its library (CadaclysmSolid.style()'s identification), or none.
"" where there is none.
Ids and history
CadaclysmSolid.track()
func track() -> CadaclysmSolid
This solid tracked: its faces numbered 1 to n in face order and its edges 1 to m in CadaclysmSolid.edges' order, each its own origin. Tracking rides on from here: a verb on a tracked solid gives a tracked result, each face keeping the id of the input face it lies on and naming that face as its origin. Tracking is opt-in because it is not free: after every verb the result's faces are matched to the inputs' faces, which measured on some 2,400 real bodies costs 47% (a split) to 287% (a fillet) of the verb's own time at the median. An untracked solid pays nothing. A tracked solid comes back as it is.
CadaclysmSolid.is_tracked
var is_tracked: bool # read-only
Whether this solid carries face and edge ids: it was CadaclysmSolid.track(), made from a tracked solid, or given an attribute.
CadaclysmSolid.face_id()
func face_id(face: int) -> int
Face face's id, null where this solid is untracked. An id stays with its face through every verb that keeps the face — a move, a boolean, a fillet of another edge — so it names "the same face, through my edits" within a session. A piece split off, a later operand's face whose id an earlier one already has, and a face on no input get fresh ids, the same run after run.
Ids and references answer different questions. Ids are not written to files and mean nothing on a model built again from scratch or read back: there, find a face by what it is with CadaclysmSolid.face_ref() and CadaclysmSolid.find_face() (an edge with CadaclysmSolid.edge_ref(), a vertex with CadaclysmSolid.vertex_ref()). A face the solid does not have returns null, false or an empty value (the reason in Cadaclysm.last_error()).
-1 where the solid is untracked — Godot has no null int, and an id is never below 1 — and for a face it does not have, the reason in Cadaclysm.last_error().
CadaclysmSolid.face_with_id()
func face_with_id(id: int) -> int
The face whose id is id, null where no face has it — an untracked solid, or a face a verb deleted.
-1 where no face has the id.
CadaclysmSolid.face_origins()
func face_origins(face: int) -> Array
The input faces face face came from, as (operand, id) pairs: the operand the input's index in the verb's operand order (a boolean's target 0, its tool 1), the id that input face's CadaclysmSolid.face_id(). The face it lies on most comes first. Empty for a face the verb generated (a fillet's round, the faces a split cuts) and on an untracked solid; more than one for a face merged from several (a join with merge). A face the solid does not have returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Each origin is an Array [operand, id].
CadaclysmSolid.edge_id()
func edge_id(edge: int) -> int
Edge edge's id (an index into CadaclysmSolid.edges), as CadaclysmSolid.face_id().
-1 where the solid is untracked, as face_id.
CadaclysmSolid.edge_with_id()
func edge_with_id(id: int) -> int
The edge whose id is id, null where no edge has it.
-1 where no edge has the id.
CadaclysmSolid.edge_origins()
func edge_origins(edge: int) -> Array
The input edge edge edge lies on, as CadaclysmSolid.face_origins(): one (operand, id), or none for a new edge. Edges merged from several are not seen.
Each origin is an Array [operand, id].
CadaclysmSolid.history()
func history(inputs: Array) -> CadaclysmHistory
What the verb that made this solid did to the faces of inputs, passed in its operand order (a.cut(b).history(a, b)), as a CadaclysmHistory: which input faces were kept, modified (split, merged or renumbered), or deleted, and which faces were generated. Read off this solid's ids and origins alone, so it costs no geometry. An untracked solid or input, or an origin naming an operand past the inputs, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Takes the inputs as one Array (a.cut(b).history([a, b])); returns a CadaclysmHistory, or null.
CadaclysmSolid.edge_history()
func edge_history(inputs: Array) -> CadaclysmHistory
CadaclysmSolid.history() for the edges, by edge id.
Takes the inputs as one Array, as history.
Attributes
CadaclysmSolid.attributes
var attributes: Dictionary # read-only
This solid's attributes: text keys and values, read-only, in key order. A solid's attributes go with it through every verb (a verb's result takes its first operand's), and they are the only attributes written to files: CadaclysmSolid.step() writes them as STEP user-defined attributes. Face attributes stay in memory.
A read-only Dictionary of Strings, built in key order.
CadaclysmSolid.attribute()
func attribute(key: String) -> Variant
Attribute key, null where this solid has none.
A String, or null — not "", which is a value an attribute can have.
CadaclysmSolid.with_attribute()
func with_attribute(key: String, value: String) -> CadaclysmSolid
This solid with attribute key set to value, over any it had: a new solid, tracked if this one was not. Keys and values are text with no NUL; an empty key returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.with_attributes()
func with_attributes(attributes: Dictionary) -> CadaclysmSolid
This solid with every attribute given set, in key order.
Takes a Dictionary of String keys and values; any other key or value is refused.
CadaclysmSolid.without_attribute()
func without_attribute(key: String) -> CadaclysmSolid
This solid without attribute key: a new solid, equal to this one where it had none.
CadaclysmSolid.face_attributes()
func face_attributes(face: int) -> Dictionary
Face face's attributes, read-only, in key order. A face's attributes follow its id: kept through a verb, and copied to every face that names it as an origin, so each piece of a split face has its parent's. They stay in memory: no file carries them. A face the solid does not have returns null, false or an empty value (the reason in Cadaclysm.last_error()).
A read-only Dictionary of Strings, built in key order.
CadaclysmSolid.face_attribute()
func face_attribute(face: int, key: String) -> Variant
Face face's attribute key, null where it has none.
A String, or null.
CadaclysmSolid.with_face_attribute()
func with_face_attribute(face: int, key: String, value: String) -> CadaclysmSolid
This solid with face face's attribute key set to value: a new solid, tracked if this one was not. Refused as CadaclysmSolid.with_attribute() is, and for a face the solid does not have.
CadaclysmSolid.with_face_attributes()
func with_face_attributes(face: int, attributes: Dictionary) -> CadaclysmSolid
This solid with every attribute given set on face face, in key order.
Takes a Dictionary of String keys and values, as with_attributes.
CadaclysmSolid.without_face_attribute()
func without_face_attribute(face: int, key: String) -> CadaclysmSolid
This solid without face face's attribute key: a new solid, equal to this one where the face had none.
Edge and vertex references
CadaclysmSolid.edge_ref()
func edge_ref(edge: int) -> PackedFloat64Array
Edge edge (an index into CadaclysmSolid.edges) by what it is, fifteen numbers: its kind (line 0, circle 1, ellipse 2, B-spline 3, other 4), its midpoint (x, y, z), its unit tangent there (x, y, z), its length, the outward normals there of the two faces meeting on it (x, y, z each; an open sheet's rim gives its one face's twice), and its span — how far from the midpoint CadaclysmSolid.find_edge() may look on a resized solid. CadaclysmSolid.face_ref()'s twin, for a feature made on an edge: unlike an id it survives a rebuild. An edge past the table, or one with no length, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
A PackedFloat64Array of fifteen; empty when refused.
CadaclysmSolid.find_edge()
func find_edge(edge_ref: PackedFloat64Array, tolerance: float = 1e-3) -> int
The edge a reference from CadaclysmSolid.edge_ref() refers to: of the edges of that kind passing within tolerance of its midpoint and running the same way, the one of nearest length; where none does (the solid was resized), the edge of that kind running the same way between faces facing the same two ways — the only one, or the one clearly nearest, no farther than the span. null where the edge is gone. A malformed reference, or a tolerance not positive, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Takes the reference as a PackedFloat64Array; one not fifteen long is refused in the same words. -1 where the edge is gone, and when refused.
CadaclysmSolid.vertex_count
var vertex_count: int # read-only
How many vertices this solid has: its edges' ends, welded, in the order CadaclysmSolid.vertex_ref() and CadaclysmSolid.find_vertex() index.
CadaclysmSolid.vertex_ref()
func vertex_ref(vertex: int) -> PackedFloat64Array
Vertex vertex by where it is: (x, y, z). A vertex the solid does not have returns null, false or an empty value (the reason in Cadaclysm.last_error()).
A PackedFloat64Array of three; empty when refused.
CadaclysmSolid.find_vertex()
func find_vertex(vertex_ref: Variant, tolerance: float = 1e-3) -> int
The vertex nearest vertex_ref — a CadaclysmSolid.vertex_ref(), or any point picked — within tolerance; null where no vertex is that near. A point that is not three finite numbers, or a tolerance not positive, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Takes a Vector3 or three numbers (an Array or PackedFloat64Array keeps the doubles). -1 where no vertex is that near, and when refused.
Colour
CadaclysmSolid.coloured()
func coloured(colour: Variant, face: int = -1) -> CadaclysmSolid
A new solid coloured (r, g, b), each 0..1, "#rgb", "#rrggbb" or a CSS colour name — or, given a face (Go: ColouredFace), just that face, whose colour then wins over the solid's. What is made from a coloured solid inherits: a move keeps every colour; a boolean, fillet, chamfer or shell gives each face the colour of the input face it lies on (a cut's bore takes the tool's), and a new face — a round, a shell's inner wall — the solid's. CadaclysmSolid.step() and CadaclysmBlacksmith.write_step() write the colours as STEP styling (AP242; a named schema that lacks styling writes the solids bare), and a solid's colour reads back as CadaclysmNode.colour.
Takes a Color, colour text ("#rgb", "#rrggbb" or a CSS colour name) or three numbers; face -1, the default, colours the whole solid. colour and face_colour() hand back a Color, or null.
CadaclysmSolid.face_colour()
func face_colour(face: int) -> Variant
A face's colour as drawn: its own, else the solid's, else none.
CadaclysmSolid.edges_coloured()
func edges_coloured(colour: Variant) -> CadaclysmSolid
A new solid with its edges coloured (r, g, b), "#rgb", "#rrggbb" or a CSS colour name: every edge, or, given edges (as CadaclysmSolid.fillet() takes them: Edge records or indices), just those, whose colour then wins over the all-edges one — an empty list colours none. Inherited as face colours are: a move keeps every edge colour; a boolean, fillet, chamfer or shell gives each edge the colour of the input edge it lies on, and a new edge (a cut's rim, a round's edges) the all-edges colour. CadaclysmSolid.step() and CadaclysmBlacksmith.write_step() write them as STEP CURVE_STYLE styling, which the reader reads back as CadaclysmNode.edge_colours.
Takes a Color, colour text or three numbers, and edges as fillet does; edge_colour() hands back a Color or null.
CadaclysmSolid.edge_colour()
func edge_colour(edge: int) -> Variant
An edge's colour as drawn: its own, else the solid's edge colour, else none.
CadaclysmSolid.brep()
func brep(path: String) -> bool
Write this solid as an OCCT .brep file; see CadaclysmBlacksmith.write_brep().
CadaclysmSolid.document_body
This solid as a Document's solid.body node holds it: the kernel's own B-rep as a record of its tables (surfaces, curves, trims, loops, faces), every number as it is, and its colours (the solid's, each face's and each edge's), so the node gives back exactly this solid, drawn as it was. What Document.add_solid puts in a document.
Not in this wrapper yet.
From files
CadaclysmSolid.open()
static func open(path: String, body: int = -1) -> CadaclysmSolid
The body a CAD file holds, as a solid: STEP (AP203/214/242), ACIS .sat, Rhino .3dm, OCCT .brep, IGES, IFC or OpenSCAD (an exact B-rep where the reader carries the kernel), read where it draws, in the file's own units and axes. A file drawing several bodies needs body (0-based, in drawing order) or CadaclysmSolid.open_all(). What such a solid can do is what its geometry allows: fillet and chamfer want line and circle edges; booleans take any surface, but new edges traced on a free-form face are not always writable back to STEP; and every verb meshes its operands first, so its cost grows with the body's face count. Reads through the reader library, which must be from the same release.
CadaclysmSolid.open_all()
static func open_all(path: String) -> Array[CadaclysmSolid]
Every body a CAD file draws, as solids placed where it draws them: one per placement, so a part placed twice is two solids.
CadaclysmSolid.from_node()
static func from_node(node: CadaclysmNode, placed: bool = true) -> CadaclysmSolid
The body a reader CadaclysmNode draws, as a solid — sharing the reader's brep (CadaclysmNode.brep), not copying it; the scene can be closed first. placed (the default) puts it where the node's transform does, where its mesh draws; otherwise it keeps the node's own frame. The two modules' layouts (CadaclysmBlacksmith.brep_layout_id()) must agree, or it returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSolid.from_mesh()
static func from_mesh(positions: Variant, triangles: Variant, weld_tolerance: float = 0.0, angle_tolerance: float = 0.0, distance_tolerance: float = 0.0, merge_planes: bool = true) -> Dictionary
A triangle mesh — positions (three numbers a vertex) and indices (three a triangle) — as a solid and a FromMeshReport: OCCT's BRepBuilderAPI_MakeShapeOnMesh, Rhino's Brep.CreateFromMesh, Fusion's faceted MeshConvertFeatures. Vertices within weld_tolerance are welded (default 1e-6 times the bounding-box diagonal) and every triangle edge two triangles share becomes one B-rep edge. A watertight, orientable mesh comes back as a closed solid: stray triangles reoriented to agree with their neighbours, each shell turned outward (or inward, where it lies inside another: a void), so the volume is positive. Anything else comes back as an open shell, the report saying why — its holes, boundary edges and edges three or more triangles share — rather than guessing. With merge_planes (the default) neighbouring triangles whose normals agree within angle_tolerance (radians, default 1 degree) and that lie on one plane within distance_tolerance (default 1e-5 times the diagonal) become one planar face, with inner loops for holes and straight runs of its outline as single line edges, its vertices snapped onto the planes they lie on: a box's mesh is 6 faces and 12 edges. Curved regions stay faceted. merge_planes off gives one face per triangle, as OCCT. No triangles, an index out of range, a coordinate that is not finite or a negative tolerance returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Returns a Dictionary {body, report} (the report a Dictionary), empty on a refusal with the reason in last_error.
CadaclysmSolid.from_mesh_node()
static func from_mesh_node(node: CadaclysmNode, weld_tolerance: float = 0.0, angle_tolerance: float = 0.0, distance_tolerance: float = 0.0, merge_planes: bool = true) -> Dictionary
CadaclysmSolid.from_mesh() on a reader CadaclysmNode's triangles — a loaded STL or OBJ, or any node with a mesh — in the node's own frame, not placed. Its double-precision mesh (CadaclysmNode.mesh64) is copied out first; the scene can be closed afterwards.
Output
CadaclysmSolid.mesh()
func mesh(tolerance: float = 0.05) -> CadaclysmMesh
Triangles at tolerance: positions, normals (three floats a vertex) and indices. In every wrapper that lends a view, views owned by a held tessellation — valid for as long as you keep the view, whatever happens to the solid: meshed again at any tolerance, closed. Rust borrows the solid for the view's lifetime instead; Node and Godot copy. A raw span, slice or buffer taken out of a view does not keep the view itself reachable in a collected language: hold the view while you read one, and copy what must outlive it. The same rule as a FEM mesh's views, for the same reason. A view pins its whole tessellation — positions, normals, indices, edges, face counts, in both precisions — until the view itself is freed or collected, whichever the language uses; for data that must outlive the view, copy() it and drop the view.
Copied out, as a CadaclysmMesh; array_mesh() builds Godot's ArrayMesh directly.
CadaclysmSolid.mesh64
CadaclysmSolid.mesh() in double precision: the same tessellation at tolerance, unnarrowed — positions and normals exact far from the origin, where CadaclysmSolid.mesh()'s float32 positions are not. A view owned by a held tessellation, like CadaclysmSolid.mesh(): valid whatever happens to the solid, in every wrapper that lends a view — Node and Godot copying instead.
Godot's geometry is single precision; the Rust SDK it is built on has it.
CadaclysmSolid.fem_mesh()
func fem_mesh(tolerance: float = 0.01, max_size: float = 0.0) -> CadaclysmSolidFemMesh
func fem_mesh_placed(tolerance: float, max_size: float, placement: Variant) -> CadaclysmSolidFemMesh
This solid meshed for a solver, as a CadaclysmSolidFemMesh: nodes welded by bits — two mesh points are one node only where their coordinates are the same doubles, so no tolerance ever merges two distinct points and a crack stays a crack — triangles wound outward, and every node tagged with the lowest-dimension B-rep entity it lies on.
tolerance is the chordal tolerance in model units, and it alone governs how closely the mesh follows the geometry. max_size is a size ceiling, 0 for none (curvature alone): it splits boundary segments to at most that length and lays interior stations max_size / √2 apart as a target, and it adds nodes without refining the boundary geometry — a caller that wants the rim nearer its curve lowers the tolerance, where max_size only makes the elements smaller. CadaclysmSolidFemMesh.longest_edge is what the mesh actually came to, and the figure to check.
placement is a CadaclysmFrame or twelve numbers — origin, x, y, z — as every frame here, and left out for the identity, a solid meshed in its own coordinates being the common case. The reader's CadaclysmNode.fem_mesh() takes sixteen, column-major, so a caller moving between the two reformats the placement.
A cracked solid is not a failure: it comes back with CadaclysmSolidFemMesh.watertight false and its cracks in CadaclysmSolidFemMesh.open_edges and CadaclysmSolidFemMesh.folded_edges, and nothing is welded shut to make it look sound. It returns null, false or an empty value (the reason in Cadaclysm.last_error()) for a tolerance or size the mesher refuses, a placement that is not twelve finite and invertible numbers, a closed solid this library cannot mesh, and a solid that meshes to no triangles at all.
No unlicensed notice here: CadaclysmSolidFemMesh.msh_text() and CadaclysmSolidFemMesh.save_msh() print it, this library noticing on its writers rather than on its builders — where the reader library notices in its own constructor and on neither .msh call.
Takes tolerance and max_size alone, both defaulted; fem_mesh_placed(tolerance, max_size, placement) is the same call with a placement — a frame, as every frame argument here: a CadaclysmFrame, a Transform3D, twelve numbers or four triples. Two entry points rather than one optional argument because Godot has no null default for one, as open/open_with are two. GDScript has no exceptions, so a failure is null: check for it.
CadaclysmSolid.face_triangles
How many triangles each face meshed to at tolerance, one count per face in face order: the triangles of CadaclysmSolid.mesh() at the same tolerance run face by face, so face f's are the counts[f] after the first counts[:f].sum(), and the counts sum to the mesh's triangle count. What a viewer colours a face by. A view, like CadaclysmSolid.mesh() — a copy in Node and Godot.
Comes with the viewers follow-up.
CadaclysmSolid.edge_polylines()
func edge_polylines(tolerance: float = 0.05) -> CadaclysmPolylines
The feature edges as polylines at tolerance, one run of points per edge. Views, like CadaclysmSolid.mesh() — copies in Node and Godot.
Copied out, as a CadaclysmPolylines.
CadaclysmSolid.edge_polyline_colours()
func edge_polyline_colours(tolerance: float = 0.05) -> Array[Variant]
A colour per polyline of CadaclysmSolid.edge_polylines() at the same tolerance, as drawn: (r, g, b), or none for a polyline on no coloured edge; an empty list where the solid has no edge paint at all — what a viewer colours the edge lines by. Copied out, unlike the polylines.
An Array of Color or null.
CadaclysmSolid.show
Draw the solid with the viewer in use — in a terminal, the picture is left in the scrollback. Each face keeps its own colour (CadaclysmSolid.face_colour(): a colour of its own, else the solid's). Keywords: view= (front, back, left, right, top, bottom, iso), az=, el=, zoom=, up=, edges=, width=, height=, hint=, tolerance=. With the GPU library (import cadaclysm.view.wgpu) the drawing replaces what one shared window shows and stays live — at the REPL, in IPython and in Jupyter by themselves, in a script until it exits; cadaclysm.view.View draws several items or several windows.
Comes with the viewers follow-up.
CadaclysmSolid.view
Orbit the solid with the viewer in use until it is closed; returns the camera where it was left — a dict of eye, target, up, orthographic, azimuth and elevation — and pick, what was last clicked (item, node, face) or None. Keywords as CadaclysmSolid.show. A fresh window, run until closed, with the GPU library.
Comes with the viewers follow-up.
CadaclysmSolid.step()
func step(path: String, schema: String = "", unit: String = "mm") -> bool
Write this solid as a STEP file (AP203, or AP242 when coloured); see CadaclysmBlacksmith.write_step() for schema and unit.
CadaclysmSolid.step_text()
func step_text(schema: String = "", unit: String = "mm") -> String
The same STEP file as text.
CadaclysmSolid.sat()
func sat(path: String, unit: String = "mm") -> bool
Write this solid as an ACIS SAT file; see CadaclysmBlacksmith.write_sat() for unit.
CadaclysmSolid.write_3dm
Write this solid as a Rhino .3dm; see CadaclysmBlacksmith.write_3dm for what it carries and unit.
Not in the Godot add-on yet: write the solid with write_step or write_sat instead.
CadaclysmSolid.rhino3dm_bytes
The same .3dm file as bytes.
Not in the Godot add-on yet: write the solid with write_step or write_sat instead.
CadaclysmSolid.svg()
func svg(path: String) -> bool
This solid's wireframe as SVG, from a camera the keywords describe — CadaclysmBlacksmith.write_drawing_svg()'s own words, read by the library itself rather than a viewer. With path, writes the file and returns null; without, returns the SVG text. returns null, false or an empty value (the reason in Cadaclysm.last_error()) on a refused option or a failed write.
CadaclysmSolid.silhouette_beziers
This solid's silhouette — the curves where its surfaces turn away from the eye, which no edge of it lies on, so a sphere has an outline here that its wireframe has none of — as rational cubic Béziers in double precision, from the camera the options describe: CadaclysmSolid.svg()'s own words, so the words that draw a picture ask about the same eye. tolerance is read as a fraction of the page's width, and nothing else in the options changes the curves; the line-set flags are not read. Exact Béziers where the surface has a closed silhouette form — sphere, cylinder, cone, extrusion — and for every other surface, a torus and a NURBS patch included, a straight-chord polyline carried as degree-1 Béziers: there is no spline fitter here, so a sphere's rim arrives as arcs and a torus's as chords.
The curves are in memory of the wrapper's own: the library's buffer is copied out and released before the call returns, so there is nothing to free and nothing that can dangle. A solid with no silhouette — one whose every face is planar, a cuboid's, since a plane has none from any eye — is an empty answer (count 0), not an error. The library clears its error slot as each call starts, so an empty answer leaves no message and a refusal leaves one; that is how the two are told apart, and why a failure from an earlier call cannot be mistaken for this call's empty answer. returns null, false or an empty value (the reason in Cadaclysm.last_error()) on a refusal — a refused option, say.
Godot has no silhouette_beziers query; the C API and the other wrappers have it.
CadaclysmSolid.silhouette_beziers_free
Release silhouette Bézier data: the data from a silhouette_beziers call, passed with its matching count. null is a no-op. The count must be the value that same call wrote through its own out-parameter — the buffer carries no length of its own.
Godot has no silhouette_beziers query, so it has no buffer to free. This documents the C function.
CadaclysmSolid.to_scene()
func to_scene(schema: String = "") -> CadaclysmScene
This solid as a reader CadaclysmScene, through STEP in memory: the door from the kernel to everything the reader does — its tree, meshes, glTF/OBJ/STL export. Needs the reader library as well.
CadaclysmSolid.close()
func close() -> void
Free the solid now. The garbage collector, or the language's scope, does it otherwise.
raw_bounds Godot only
func raw_bounds(tolerance: float = 0.05) -> PackedFloat64Array
CadaclysmSolid.bounds_at() as six doubles, min x, y, z then max x, y, z, where an AABB holds floats; empty on failure.
array_mesh and edge_mesh Godot only
func array_mesh(tolerance: float = 0.05) -> ArrayMesh
func edge_mesh(tolerance: float = 0.05, colour: Color = Color(0.07, 0.07, 0.08)) -> ArrayMesh
The triangles at tolerance as an ArrayMesh, wound for Godot, painted the solid's colour (or grey), both sides drawn where it is an open sheet; and its feature edges as a lines ArrayMesh, unshaded in colour. Sizes are the model's own units, millimetres as a rule: scale the node that draws them into Godot's metres.
edges_coloured_with Godot only
func edges_coloured_with(colour: Variant, edges: Variant) -> CadaclysmSolid
CadaclysmSolid.edges_coloured() split as svg_text/svg_text_with are, GDScript having no truly-immutable value to default edges to: edges_coloured(colour) colours every edge, edges_coloured_with(colour, edges) picks edges as fillet does — null every edge (edges_coloured's own case), an empty list none.
svg_text and svg_with Godot only
func svg_text() -> String
func svg_text_with(options: Dictionary) -> String
func svg_with(path: String, options: Dictionary) -> bool
CadaclysmSolid.svg() split as CadaclysmBlacksmith's write_svg_text/write_svg_with are: svg_text()/svg(path) with every default, svg_text_with(options)/svg_with(path, options) with the keywords as a Dictionary.
CadaclysmAssembly
class CadaclysmAssembly extends RefCounted
A mutable tree of placements: a name, and zero or more solids or other assemblies placed in it at a frame. Unlike CadaclysmSolid, placing shares rather than copies — placing one assembly under another does not snapshot it, so a later placement on the shared one shows up wherever it already sits. Close it when done, or let the language's scope do it; see Lifetimes — closing an assembly does not free what was placed in it if that is still reachable from somewhere else.
CadaclysmAssembly.name
var name: String # read-only
This assembly's own name, given when it was made.
CadaclysmAssembly.place()
func place(thing: Variant, frame: Variant, name: String = "") -> String
Place thing (a CadaclysmSolid or another CadaclysmAssembly) at frame in this assembly, called name — or, with name left out, thing's own name (CadaclysmSolid.name for a solid, "part" for an unnamed one, or the placed assembly's own name), numbered past any already taken here ("bolt", "bolt 2", ...). frame must be right-handed and orthonormal, or the call returns null, false or an empty value (the reason in Cadaclysm.last_error()). An explicit name already taken here returns null, false or an empty value (the reason in Cadaclysm.last_error()). Placing an assembly that is this one, or anywhere above this one in the tree already, returns null, false or an empty value (the reason in Cadaclysm.last_error()) naming the cycle, since writing that out would never terminate. Returns the placement's name.
CadaclysmAssembly.link()
func link(name: String, placements: PackedStringArray) -> bool
Declare a rigid link called name over placements: a list of names of placements of this assembly itself (not of assemblies placed in it — give those their own mechanism); in Python, Node and LuaJIT, a single name in place of the list is refused. A placed assembly in a link moves as one piece. An empty name, a name taken by another link here, no placements, a placement named twice, one this assembly does not have, or one already in another link returns null, false or an empty value (the reason in Cadaclysm.last_error()), and the assembly is left as it was. Written as an AP242 kinematic link; a mechanism anywhere in the tree makes AP242 the default schema of CadaclysmAssembly.step_text(), and an explicit schema without the kinematic entities returns null, false or an empty value (the reason in Cadaclysm.last_error()). A reader CadaclysmScene reads it back as links and joints.
CadaclysmAssembly.joint()
func joint(name: String, start: String, end: String) -> bool
Connect this assembly's links start and end, kept in that order, as a joint called name. An empty name, a name taken by another joint here, a link this assembly does not have, a link joined to itself or a (start, end) pair already joined returns null, false or an empty value (the reason in Cadaclysm.last_error()); the reverse pair is a different joint.
CadaclysmAssembly.pair()
func pair(joint: String, kind: String, frame: Variant, end_frame: Variant, ranges: Array, pitch: float) -> bool
Give joint joint its pair: kind (one of revolute, prismatic, cylindrical, screw, spherical, spherical_with_pin, planar, universal, homokinetic, fully_constrained or unconstrained), the contact frame at rest, an optional end_frame (the frame the pair reaches at its rest values; frame itself, i.e. all-zero rest values, when left out), ranges (one entry per freedom of kind, each unbounded or a lower/upper pair; left out entirely for a kind that allows none), and pitch (required and non-zero for screw, refused for any other kind). An unknown or already-paired joint, an unknown kind, a bad pitch, ranges given where none are allowed or of the wrong length, a non-finite or inverted range, or an end_frame this kind's motion cannot reach (or reaches only outside a given range) returns null, false or an empty value (the reason in Cadaclysm.last_error()), and the assembly is left as it was.
CadaclysmAssembly.pair_with()
func pair_with(joint: String, kind: String, frame: Variant, end_frame: Variant, ranges: Array, params: PackedFloat64Array) -> bool
CadaclysmAssembly.pair() with the kind's own numbers, params, in place of the pitch — for the coupled pairs: kind any kind pair takes, or gear or rack_and_pinion; params [pitch] for screw, [pinion_radius] for rack_and_pinion, [radius_first, radius_second, ratio] or those plus [bevel, helical_angle] (radians) for gear — the ratio the second link's rotation over the first's, signed, so two meshing external gears have a negative one — and none for any other kind. Written as AP242's screw_pair, rack_and_pinion_pair and gear_pair (whose gear_ratio is the ratio negated); a reader CadaclysmScene gives them back as CadaclysmPair.kind_name and CadaclysmPair.parameters, and posing turns a coupled joint from its driver. A wrong number of parameters, a non-finite one, a zero pitch, radius or ratio, or anything pair refuses returns null, false or an empty value (the reason in Cadaclysm.last_error()), and the assembly is left as it was.
CadaclysmAssembly.state()
func state(name: String, rows: Array) -> bool
Add a named state: the rows (Python: a mapping, or an iterable of (joint, values) pairs) set each named joint to its values, in that joint's pair's freedom order. An empty or duplicate name, no rows, an unknown joint, a joint set twice, a joint with no pair or none of its pair's freedoms, a row of the wrong length, or a non-finite or out-of-range value returns null, false or an empty value (the reason in Cadaclysm.last_error()), and the assembly is left as it was.
CadaclysmAssembly.sequence()
func sequence(name: String, segments: Array, seconds: bool = false) -> bool
Add a named motion sequence over this assembly's states: segments are (state name, parameter, interpolation) rows, the interpolation one of "undefined", "discontinuous", "synchronous" or "linear", and seconds writes the parameter's unit as the second. Closed or open is the last segment's interpolation: closed unless it is "discontinuous". An empty or duplicate name, fewer than two segments, an unknown state, a non-finite or decreasing parameter, or an unknown interpolation returns null, false or an empty value (the reason in Cadaclysm.last_error()), and the assembly is left as it was.
CadaclysmAssembly.base()
func base(link: String) -> bool
Declare this assembly's base link. link naming no link of this assembly, or a base already declared, returns null, false or an empty value (the reason in Cadaclysm.last_error()) naming the link already there.
CadaclysmAssembly.pose()
func pose(values: Variant, state: String = "", ground: String = "") -> CadaclysmAssembly
This assembly with its mechanism posed, as a new assembly; this one is left as it was. Each joint is named by its path — the placement names down the tree, then the joint's name, joined by / ("drive FL/spin"), a / or \ inside a name escaped with \ — or by its bare name, which means a joint of this assembly by that name, else the only joint of that name anywhere under it; each copy of a sub-assembly placed more than once poses on its own. Values are absolute, one per freedom of the joint's pair, radians for rotations and the assembly's units for translations. A state's path is applied first and overridden joint by joint; ground names one of this assembly's links to hold fixed (default: its base, else its busiest link). A sub-assembly no key reaches is shared with this one. An unknown or ambiguous key, a joint given twice, one without a pair, the wrong number of values, a value that is not finite or is outside its range, an unknown state or link, or a loop the pose leaves open returns null, false or an empty value (the reason in Cadaclysm.last_error()). Whether the parts meet on the way from one pose to the next is CadaclysmAssembly.swept_clash()'s question.
CadaclysmAssembly.parts()
func parts() -> PackedStringArray
The placement path of every solid under this assembly, at any depth: depth first, placements in order, the placement names down the tree joined by /, a / or \ inside a name escaped with \, as CadaclysmAssembly.pose()'s keys are ("a\/b/x" for part x of a sub-assembly placed as a/b). The index CadaclysmAssembly.swept_clash()'s rows use. Empty for an assembly that places no solid.
CadaclysmAssembly.swept_clash()
func swept_clash(keyframes: Array, clearance: float = 0.0, tolerance: float = 0.05, resolution: float = 1e-3, max_steps: int = 100000, allowed: PackedInt32Array = PackedInt32Array(), ground: String = "", joined: bool = false) -> Variant
Every pair of this assembly's solids, indexed as CadaclysmAssembly.parts() lists them, that penetrates, touches or comes within clearance of the other anywhere while this assembly's own mechanism moves through keyframes, as CadaclysmSweptClash rows in pair order. Each keyframe maps joint keys to values as CadaclysmAssembly.pose()'s values do, and every keyframe names the same joints with the same number of values each (the first keyframe fixes their order); time runs in keyframe units, keyframe k at time k.
Between two keyframes each joint value moves linearly and each link is posed from those values, as CadaclysmAssembly.pose() poses it: a link swinging about a joint goes round its arc, not along its chord, and a coupled joint turns from its driver. Only this assembly's own joints move: a key into a sub-assembly is refused, and a sub-assembly rides the link its placement is in. ground names one of this assembly's links to hold fixed (default: its base, else its busiest link); solids in no link stay still too. Pairs on the two links a joint joins are not tested unless joined; allowed pairs of part indices are never tested. tolerance (0.05 by default) meshes the parts; the guarantee, resolution and max_steps are CadaclysmCollider.swept_clash()'s, and each row's first is the CadaclysmClash at the posed frames, so its CadaclysmClash.solid() rebuilds the contact.
Fewer than two keyframes, keyframes naming different joints or a different number of values for one, a joint given twice, a key into a sub-assembly, anything CadaclysmAssembly.pose() refuses of a key or its values, an unknown ground, a loop the motion leaves open, an allowed pair that is not two indices or one out of range, a part that is not a closed solid, or a bad tolerance, clearance, resolution or max_steps returns null, false or an empty value (the reason in Cadaclysm.last_error()); the kernel's own words are prefixed swept_clash:.
Each keyframe is a Dictionary or an array of [joint, values] rows, as posed's values. allowed is a flat PackedInt32Array, as CadaclysmBlacksmith.clash's; ground "" (the default) is Python's None.
CadaclysmAssembly.step_text()
func step_text(schema: String = "", unit: String = "mm") -> String
This assembly, and everything placed under it, as one STEP file: this assembly the root product, each sub-assembly and each distinct part (the same solid with the same paint and name) written once, each placement an occurrence named as it was placed. schema and unit as CadaclysmBlacksmith.write_step(). An assembly reachable from this one, this one included, that places nothing returns null, false or an empty value (the reason in Cadaclysm.last_error()) — a reader would never show it.
CadaclysmAssembly.step()
func step(path: String, schema: String = "", unit: String = "mm") -> bool
CadaclysmAssembly.step_text() written to a file.
CadaclysmAssembly.rhino3dm_bytes
This assembly, and everything placed under it, as one Rhino .3dm: each distinct part (as CadaclysmAssembly.step_text() counts them) a block holding its body, each sub-assembly a block of references to what it places — so nested assemblies are nested blocks — and this assembly's own placements references at the top of the file, on a layer named after it. Each reference is named as its placement was; block names are the parts' and assemblies' names made ones Rhino takes and numbered past any already taken, whatever their case. Bodies, colours and unit as CadaclysmBlacksmith.write_3dm. An assembly reachable from this one, this one included, that places nothing returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Not in the Godot add-on yet: write the solid with write_step or write_sat instead.
CadaclysmAssembly.write_3dm
CadaclysmAssembly.rhino3dm_bytes written to a file by the library itself.
Not in the Godot add-on yet: write the solid with write_step or write_sat instead.
CadaclysmAssembly.to_scene()
func to_scene(schema: String = "") -> CadaclysmScene
This assembly as a reader CadaclysmScene, through STEP in memory; see CadaclysmSolid.to_scene().
CadaclysmAssembly.close()
func close() -> void
Free this handle now. The garbage collector, or the language's scope, does it otherwise.
create Godot only
static func create(name: String) -> CadaclysmAssembly
Python's Assembly(name): a new, empty assembly called name, or null for an empty one. (new is GDScript's own, as CadaclysmFrame.create is, so the constructor is create.)
CadaclysmHistory
class CadaclysmHistory extends RefCounted
What a verb did to its inputs' faces (or edges) — what CadaclysmSolid.history() and CadaclysmSolid.edge_history() return, read off the result's ids and origins alone. An input face is named (operand, id): the operand its input's index in the verb's operand order (a boolean's target 0, its tool 1), the id its CadaclysmSolid.face_id(). Each list is in (operand, id) order, generated in id order.
CadaclysmHistory.kept
var kept: Array # read-only
The inputs that became exactly one output and kept their id, each as (input, output id).
Each an Array [[operand, id], output id].
CadaclysmHistory.modified
var modified: Array # read-only
The inputs split (several outputs name them), merged (their output has other origins too) or renumbered (a cut's bore, a later operand's clashing id), each as (input, [output ids]); a split's first piece, which keeps the id, comes first.
Each an Array [[operand, id], [output ids]].
CadaclysmHistory.generated
var generated: Array # read-only
The outputs with no origin: a fillet's round, the faces a split cuts.
An Array of ints.
CadaclysmHistory.deleted
var deleted: Array # read-only
The inputs no output names, such as the caps of a cut's tool.
Each an Array [operand, id].
CadaclysmEdge
class CadaclysmEdge extends RefCounted
One edge of a solid as plain data, copied out of it: what CadaclysmSolid.edges lists and CadaclysmSolid.fillet() takes.
A method that takes edges — CadaclysmSolid.fillet(), CadaclysmSolid.chamfer(), CadaclysmSolid.edges_coloured() — takes a list of them, CadaclysmEdge values or their indices, and refuses a single one: one edge is a list of one. So do the face and corner lists of CadaclysmSolid.drop_faces(), CadaclysmSolid.shell() and CadaclysmProfile.round(); CadaclysmSolid.push_pull() takes one face on its own or a list.
CadaclysmEdge.index
var index: int # read-only
Its index — what CadaclysmSolid.fillet() and CadaclysmSolid.chamfer() take.
CadaclysmEdge.kind
var kind: String # read-only
The curve: line, circle, ellipse, parabola, hyperbola, nurbs or other.
CadaclysmEdge.faces
var faces: PackedInt32Array # read-only
The faces meeting on it, as face indices.
CadaclysmEdge.segments
var segments: PackedVector3Array # read-only
The two ends of each piece of the edge.
CadaclysmEdge.curve
var curve: Variant # read-only
The edge's exact curve, as a CadaclysmCurve — null for an edge with no exact curve (kind other). Filled when the edges are listed, so the edge stays plain data.
CadaclysmEdge.direction
var direction: Variant # read-only
The unit direction of a straight edge, or null for a curved one. Picking the vertical edges of a plate is a filter on this.
raw_segments Godot only
var raw_segments: PackedFloat64Array # read-only
CadaclysmEdge.segments as doubles, six a segment, where segments holds Vector3s of floats.
CadaclysmCurve
class CadaclysmCurve extends RefCounted
One edge's, or one intersection chain's, exact curve as plain data, copied out: what CadaclysmEdge.curve or CadaclysmChain.curve holds. kind is line, circle, ellipse, parabola, hyperbola or nurbs.
t0..t1 is the edge's (or the chain's) parameter range on its own curve: a line's fraction (0..1 over origin -> origin + x, where x is the full to - from, NOT unit — so point(t) = origin + x*t); a circle's or ellipse's angle in radians about origin in the x, y plane (point(t) = origin + x*radius*cos(t) + y*radius2*sin(t), radius2 = radius for a circle); a parabola's own parameter with radius its focal length F (point(t) = origin + x*F*t*t + y*2*F*t, radius2 0); a hyperbola's with radius, radius2 its semi-axes a, b (point(t) = origin + x*a*cosh(t) + y*b*sinh(t)); a NURBS's knot parameter (knots[degree] <= t0 < t1 <= knots[n]). Frame vectors x, y, z are unit for conics; for a line x is the direction with length = the line's length and y, z are zero. Always t0 < t1: an edge whose segments run against its curve's own parameter reports the same range — read the direction from CadaclysmEdge.segments, not from the range. A chain's CadaclysmChain.points always run WITH the curve's own parameter instead: point(t0) is the chain's first point and point(t1) its last for an open chain (a closed chain simply goes once round, t0..t1 its whole domain).
For a NURBS the frame is zero and so are the radii; for a conic or a line degree is 0 and knots, poles are empty. Evaluating point(t) is left to the caller for now.
CadaclysmCurve.kind
var kind: String # read-only
The curve: line, circle, ellipse, parabola, hyperbola or nurbs. Never other: a curve of that kind is null instead.
CadaclysmCurve.origin
var origin: Vector3 # read-only
The frame's origin, three numbers: a circle's or ellipse's centre, a parabola's vertex, a hyperbola's centre, a line's start. Zero for a NURBS.
A Vector3, of floats; raw_frame keeps the twelve doubles of the whole frame.
CadaclysmCurve.x
var x: Vector3 # read-only
The frame's first axis: a conic's unit direction at angle 0 (a parabola's or hyperbola's axis); for a line the whole to - from, so origin + x is its far end. Zero for a NURBS.
A Vector3, of floats; raw_frame keeps the doubles.
CadaclysmCurve.y
var y: Vector3 # read-only
The frame's second axis: a conic's unit direction at a quarter turn. Zero for a line or a NURBS.
A Vector3, of floats; raw_frame keeps the doubles.
CadaclysmCurve.z
var z: Vector3 # read-only
The frame's normal, x cross y, unit for a conic. Zero for a line or a NURBS.
A Vector3, of floats; raw_frame keeps the doubles.
CadaclysmCurve.radius
var radius: float # read-only
A circle's radius, an ellipse's along x, a parabola's focal length, a hyperbola's semi-axis along x; 0 for a line or a NURBS.
CadaclysmCurve.radius2
var radius2: float # read-only
An ellipse's radius along y, a hyperbola's semi-axis along y; equal to radius for a circle; 0 for a parabola, a line or a NURBS.
CadaclysmCurve.t0
var t0: float # read-only
Where the edge starts on the curve, in the range convention above.
CadaclysmCurve.t1
var t1: float # read-only
Where it ends: greater than t0. A whole circle is one edge, t1 - t0 a full turn. On a conic t1 may exceed 2pi when the arc crosses angle 0 (say t0 5.6, t1 7.0): keep the angles as reported and never normalise them into 0..2pi, or the arc is drawn the long way round.
CadaclysmCurve.knots
var knots: PackedFloat64Array # read-only
A NURBS's knot vector, poles + degree + 1 long; empty for a conic or a line.
CadaclysmCurve.poles
var poles: PackedFloat64Array # read-only
A NURBS's control points, three numbers each; empty for a conic or a line.
A flat PackedFloat64Array, three a pole, as raw_segments is flat.
CadaclysmCurve.value()
func value() -> Variant
This curve as a value: a line a CadaclysmLine from origin to origin + x; a circle a CadaclysmCircle over a full turn, else the CadaclysmArc over t0..t1; an ellipse its whole CadaclysmEllipse (the range stays here: there is no elliptical-arc value); any other kind null.
CadaclysmCurve.weights
var weights: PackedFloat64Array # read-only
One weight per pole for a rational NURBS; null for a plain (non-rational) B-spline, a conic or a line.
An empty PackedFloat64Array where Python has None; is_rational tells the two apart.
raw_frame Godot only
var raw_frame: PackedFloat64Array # read-only
CadaclysmCurve.origin, CadaclysmCurve.x, CadaclysmCurve.y and CadaclysmCurve.z as twelve doubles, in that order, where the four properties hold Vector3s of floats.
is_rational Godot only
var is_rational: bool # read-only
Whether CadaclysmCurve.weights are there — a rational NURBS. weights is an empty array otherwise, where Python has None.
CadaclysmIntersection
class CadaclysmIntersection extends RefCounted
What CadaclysmSolid.intersect() found, copied out: chains, one CadaclysmChain per face pair per branch of the crossing, and overlaps, one CadaclysmOverlap per coincident face pair sharing a region. Both empty where the solids do not meet.
CadaclysmIntersection.chains
var chains: Array[CadaclysmChain] # read-only
Every crossing found, as CadaclysmChain values.
CadaclysmIntersection.overlaps
var overlaps: Array[CadaclysmOverlap] # read-only
Every coincident face pair sharing a region, as CadaclysmOverlap values.
CadaclysmChain
class CadaclysmChain extends RefCounted
One branch of one face pair's crossing, as plain data: one of CadaclysmIntersection.chains. Every point is within tolerance of both faces' exact surfaces. There is one chain per face pair per branch — a chain does not cross a face boundary or a closed curve's own seam, so a crossing that runs past either comes back as more than one chain, and a caller joins them by matching ends. closed when the chain's own ends meet.
CadaclysmChain.points
var points: PackedVector3Array # read-only
The points along the crossing, in walk order; a closed chain does not repeat its first point.
A PackedVector3Array; raw_points keeps the doubles, three a point.
CadaclysmChain.face_a
var face_a: int # read-only
var face_b: int # read-only
The two faces that cross: the index in the first solid CadaclysmSolid.intersect() was called on, then the index in the second.
CadaclysmChain.tangent
var tangent: bool # read-only
Whether the two surfaces are near-tangent along the chain, or the snap did not settle within tolerance — the points are then the best estimate found, not exact to the tolerance everywhere. A closed chain that does not go once round its own curve (a sliver of mesh noise where two surfaces barely cross) is reported with no curve at all, tangent still true.
CadaclysmChain.curve
var curve: Variant # read-only
The crossing's exact curve, as a CadaclysmCurve over the chain's own t0..t1 — null where no curve fits every point of the chain within tolerance (tangent noise, or a crossing with no closed form).
raw_points Godot only
var raw_points: PackedFloat64Array # read-only
CadaclysmChain.points as doubles, three a point, where points holds a PackedVector3Array.
CadaclysmOverlap
class CadaclysmOverlap extends RefCounted
A face of the first solid and a face of the second that coincide — lie on one surface and share a region — as plain data: one of CadaclysmIntersection.overlaps. A face pair sharing only an edge or a rim (no shared region: two pipes end to end, two boxes flush on a side) is silent — neither an overlap nor a chain. Two coincident planes give their exact common region — two offset boxes the rectangle they share, an L under a box the L. On a curved surface loops are the rings of either outline lying wholly inside the other face, and may come back empty where the two outlines cross: a valid answer, not an error.
CadaclysmOverlap.face_a
var face_a: int # read-only
var face_b: int # read-only
The two coincident faces: the index in the first solid CadaclysmSolid.intersect() was called on, then the index in the second.
CadaclysmOverlap.loops
var loops: Array[PackedVector3Array] # read-only
The shared region's boundary: closed rings of points on the surface, outer loop before holes, each ring's first point not repeated.
An Array of PackedVector3Arrays; raw_loops keeps each ring as doubles, three a point.
raw_loops Godot only
var raw_loops: Array[PackedFloat64Array] # read-only
CadaclysmOverlap.loops as doubles per ring, three a point, where loops holds an Array of PackedVector3Arrays.
CadaclysmFinding
class CadaclysmFinding extends RefCounted
One thing wrong with one argument of CadaclysmSolid.check(), as plain data. index, other and size are what its kind gives, and null, null and 0 where it gives none.
CadaclysmFinding.kind
var kind: String # read-only
What is wrong: no_faces; open (index the edge — null for a side naming none — other its face, size its length); region_wall; non_manifold; face_kind (index the face); short_edge (index the edge, size its length); collapsed_edge (index the trim); sliver_face (index the face, size its width); tiny_face (index the face, size its area); tiny_body (size its diagonal); small_hole (index the loop, size its area or width); loose_edge (index the edge, size how far its sides part); curve_on_surface (index the edge — a trim's index for a trim naming none — other the face, size the largest deviation); c0_inside (inside a face: index the face, other null; along an edge's curve: index the edge, other the lowest-numbered face it bounds; size the angle, in radians); self_intersection (index and other the two faces — one face twice for a fold — size the crossing's length); self_overlap (index and other the two faces); unmeshable; and on the pair, argument 0 with index in the solid checked and other in other: merge_vertex (the two vertices, size their distance), merge_edge (the two edges, size the largest gap), merge_face (the two faces, size the largest separation), tangent_face (the two faces, size the tangent stretch's length).
CadaclysmFinding.argument
var argument: int # read-only
Which argument: 0 the solid CadaclysmSolid.check() was called on, 1 other; 0 for the four kinds on the pair.
CadaclysmFinding.index
var index: int # read-only
The vertex, edge, face, trim or loop the kind names; null where it names none.
CadaclysmFinding.other
var other: int # read-only
The second index the kind gives (an open edge's face, the face an edge leaves or creases on, the second face of a self-intersection, other's vertex, edge or face for a kind on the pair); null where it gives none.
CadaclysmFinding.size
var size: float # read-only
The length, width, area, gap or angle the kind gives; 0 where it gives none.
Mass
What a body measures, per unit density: what CadaclysmSolid.mass() returns. Every figure carries a bound on its own error, because a measurement without one cannot be compared with anybody else's — including another kernel's. Measured on the exact surfaces where a face has one and on a mesh where it has not, which Mass.from_mesh reports.
No class: solid.mass(accuracy) returns a Dictionary — closed, inverted, accuracy_met and from_mesh (bools), area, area_error, volume, volume_error, centroid_error and inertia_error (floats), centroid and principal_moments (PackedFloat64Arrays of three) and inertia and principal_axes (of nine, row-major). Doubles for the same reason the FEM mesh's are: what a measurement is worth is the f64 the library computed, and Godot's Vector3 holds floats. There is no weight helper: it is density * mass["volume"].
Mass.closed
The body is topologically closed. Only then do the volume, the centroid and the inertia mean anything; they are not numbers at all otherwise.
No class: solid.mass(accuracy) returns a Dictionary — closed, inverted, accuracy_met and from_mesh (bools), area, area_error, volume, volume_error, centroid_error and inertia_error (floats), centroid and principal_moments (PackedFloat64Arrays of three) and inertia and principal_axes (of nine, row-major). Doubles for the same reason the FEM mesh's are: what a measurement is worth is the f64 the library computed, and Godot's Vector3 holds floats. There is no weight helper: it is density * mass["volume"].
Mass.inverted
Every face pointed inward. The figures are given as if they had not.
No class: solid.mass(accuracy) returns a Dictionary — closed, inverted, accuracy_met and from_mesh (bools), area, area_error, volume, volume_error, centroid_error and inertia_error (floats), centroid and principal_moments (PackedFloat64Arrays of three) and inertia and principal_axes (of nine, row-major). Doubles for the same reason the FEM mesh's are: what a measurement is worth is the f64 the library computed, and Godot's Vector3 holds floats. There is no weight helper: it is density * mass["volume"].
Mass.accuracy_met
Every error came under the accuracy asked for. false where the refinement gave up first — the values and their errors are still honest, simply less certain.
No class: solid.mass(accuracy) returns a Dictionary — closed, inverted, accuracy_met and from_mesh (bools), area, area_error, volume, volume_error, centroid_error and inertia_error (floats), centroid and principal_moments (PackedFloat64Arrays of three) and inertia and principal_axes (of nine, row-major). Doubles for the same reason the FEM mesh's are: what a measurement is worth is the f64 the library computed, and Godot's Vector3 holds floats. There is no weight helper: it is density * mass["volume"].
Mass.from_mesh
Measured on a mesh rather than on exact surfaces: exact for that mesh, and its errors are then the rounding floor rather than a statement about the surface.
No class: solid.mass(accuracy) returns a Dictionary — closed, inverted, accuracy_met and from_mesh (bools), area, area_error, volume, volume_error, centroid_error and inertia_error (floats), centroid and principal_moments (PackedFloat64Arrays of three) and inertia and principal_axes (of nine, row-major). Doubles for the same reason the FEM mesh's are: what a measurement is worth is the f64 the library computed, and Godot's Vector3 holds floats. There is no weight helper: it is density * mass["volume"].
Mass.of
Measure solid at accuracy, which is the same call as CadaclysmSolid.mass() written the other way round: Mass.of(solid) where the body reads better as the object of the sentence.
Not in GDScript: solid.mass() is the only spelling.
Mass.mass
density * volume, in whatever units the model and the density agree on. Per unit density is what everything here is, because an assembly of two materials would have to undo a density applied on its behalf — so Mass.of(part).mass(7850) is a steel part in kilograms where the model is in metres, and the inertia scales the same way.
No helper: a Dictionary has no methods, so it is density * mass["volume"].
Mass.area
The surface area.
No class: solid.mass(accuracy) returns a Dictionary — closed, inverted, accuracy_met and from_mesh (bools), area, area_error, volume, volume_error, centroid_error and inertia_error (floats), centroid and principal_moments (PackedFloat64Arrays of three) and inertia and principal_axes (of nine, row-major). Doubles for the same reason the FEM mesh's are: what a measurement is worth is the f64 the library computed, and Godot's Vector3 holds floats. There is no weight helper: it is density * mass["volume"].
Mass.area_error
A bound on area's own error.
No class: solid.mass(accuracy) returns a Dictionary — closed, inverted, accuracy_met and from_mesh (bools), area, area_error, volume, volume_error, centroid_error and inertia_error (floats), centroid and principal_moments (PackedFloat64Arrays of three) and inertia and principal_axes (of nine, row-major). Doubles for the same reason the FEM mesh's are: what a measurement is worth is the f64 the library computed, and Godot's Vector3 holds floats. There is no weight helper: it is density * mass["volume"].
Mass.volume
The volume enclosed, where Mass.closed.
No class: solid.mass(accuracy) returns a Dictionary — closed, inverted, accuracy_met and from_mesh (bools), area, area_error, volume, volume_error, centroid_error and inertia_error (floats), centroid and principal_moments (PackedFloat64Arrays of three) and inertia and principal_axes (of nine, row-major). Doubles for the same reason the FEM mesh's are: what a measurement is worth is the f64 the library computed, and Godot's Vector3 holds floats. There is no weight helper: it is density * mass["volume"].
Mass.volume_error
A bound on volume's own error.
No class: solid.mass(accuracy) returns a Dictionary — closed, inverted, accuracy_met and from_mesh (bools), area, area_error, volume, volume_error, centroid_error and inertia_error (floats), centroid and principal_moments (PackedFloat64Arrays of three) and inertia and principal_axes (of nine, row-major). Doubles for the same reason the FEM mesh's are: what a measurement is worth is the f64 the library computed, and Godot's Vector3 holds floats. There is no weight helper: it is density * mass["volume"].
Mass.centroid
The volume's centroid, where Mass.closed.
No class: solid.mass(accuracy) returns a Dictionary — closed, inverted, accuracy_met and from_mesh (bools), area, area_error, volume, volume_error, centroid_error and inertia_error (floats), centroid and principal_moments (PackedFloat64Arrays of three) and inertia and principal_axes (of nine, row-major). Doubles for the same reason the FEM mesh's are: what a measurement is worth is the f64 the library computed, and Godot's Vector3 holds floats. There is no weight helper: it is density * mass["volume"].
Mass.centroid_error
A bound on the distance from centroid to the true centroid.
No class: solid.mass(accuracy) returns a Dictionary — closed, inverted, accuracy_met and from_mesh (bools), area, area_error, volume, volume_error, centroid_error and inertia_error (floats), centroid and principal_moments (PackedFloat64Arrays of three) and inertia and principal_axes (of nine, row-major). Doubles for the same reason the FEM mesh's are: what a measurement is worth is the f64 the library computed, and Godot's Vector3 holds floats. There is no weight helper: it is density * mass["volume"].
Mass.inertia
The inertia tensor about the centroid, row-major and symmetric, products of inertia negated (inertia[0][1] is minus the integral of (x - gx)(y - gy)).
No class: solid.mass(accuracy) returns a Dictionary — closed, inverted, accuracy_met and from_mesh (bools), area, area_error, volume, volume_error, centroid_error and inertia_error (floats), centroid and principal_moments (PackedFloat64Arrays of three) and inertia and principal_axes (of nine, row-major). Doubles for the same reason the FEM mesh's are: what a measurement is worth is the f64 the library computed, and Godot's Vector3 holds floats. There is no weight helper: it is density * mass["volume"].
Mass.inertia_error
A bound on every entry of inertia.
No class: solid.mass(accuracy) returns a Dictionary — closed, inverted, accuracy_met and from_mesh (bools), area, area_error, volume, volume_error, centroid_error and inertia_error (floats), centroid and principal_moments (PackedFloat64Arrays of three) and inertia and principal_axes (of nine, row-major). Doubles for the same reason the FEM mesh's are: what a measurement is worth is the f64 the library computed, and Godot's Vector3 holds floats. There is no weight helper: it is density * mass["volume"].
Mass.principal_moments
The tensor's eigenvalues, ascending.
No class: solid.mass(accuracy) returns a Dictionary — closed, inverted, accuracy_met and from_mesh (bools), area, area_error, volume, volume_error, centroid_error and inertia_error (floats), centroid and principal_moments (PackedFloat64Arrays of three) and inertia and principal_axes (of nine, row-major). Doubles for the same reason the FEM mesh's are: what a measurement is worth is the f64 the library computed, and Godot's Vector3 holds floats. There is no weight helper: it is density * mass["volume"].
Mass.principal_axes
Their axes, one unit vector each, in the same order.
No class: solid.mass(accuracy) returns a Dictionary — closed, inverted, accuracy_met and from_mesh (bools), area, area_error, volume, volume_error, centroid_error and inertia_error (floats), centroid and principal_moments (PackedFloat64Arrays of three) and inertia and principal_axes (of nine, row-major). Doubles for the same reason the FEM mesh's are: what a measurement is worth is the f64 the library computed, and Godot's Vector3 holds floats. There is no weight helper: it is density * mass["volume"].
CadaclysmOrientedBox
class CadaclysmOrientedBox extends RefCounted
What CadaclysmSolid.oriented_box() returns: a closed solid's box on its principal axes. Not the minimal box in general, and with equal moments the axes are a free choice; see CadaclysmSolid.oriented_box().
CadaclysmOrientedBox.centre
var centre: Vector3 # read-only
The box's middle, not the body's centroid.
A Vector3, of floats; raw_centre keeps the doubles.
CadaclysmOrientedBox.axes
var axes: PackedVector3Array # read-only
The three unit axes, one row each: orthonormal and right-handed.
A PackedVector3Array of three, of floats; raw_axes keeps the doubles, nine of them, row-major.
CadaclysmOrientedBox.half
var half: Vector3 # read-only
The half-extent along each axis, grown by the tolerance the measurement settled on.
A Vector3, of floats; raw_half keeps the doubles.
raw_centre and raw_half Godot only
var raw_centre: PackedFloat64Array # read-only
var raw_half: PackedFloat64Array # read-only
CadaclysmOrientedBox.centre and CadaclysmOrientedBox.half as three doubles each, where the properties hold Vector3s of floats.
raw_axes Godot only
var raw_axes: PackedFloat64Array # read-only
CadaclysmOrientedBox.axes as nine doubles, row-major: row i is the direction of half[i], where axes holds a PackedVector3Array of floats.
CadaclysmLength
class CadaclysmLength extends RefCounted
A measured length — what CadaclysmSolid.edge_length() and CadaclysmProfile.length() return — beside an estimate of its error. The error is an estimate of the distance from the true length, not a proof.
CadaclysmLength.error
var error: float # read-only
An estimate of how far length is from the true length.
CadaclysmLength.accuracy_met
var accuracy_met: bool # read-only
The error came under the accuracy asked for. false where the refinement stopped at its depth limit first: the figure is then less certain than was asked, and error says by how much.
CadaclysmLength.from_polyline
var from_polyline: bool # read-only
The curve was a sampled polyline: exact for its points and not for whatever they were sampled from.
LengthMass
A curve's length mass properties per unit length density — what CadaclysmNurbsCurve.mass() returns, as Rhino's LengthMassProperties — each figure beside an estimate of its own error. Where two principal moments agree within inertia_error, any orthonormal pair spanning their plane is as right as another.
No class: curve.mass(accuracy) returns a Dictionary — length, length_error, centroid_error and inertia_error (floats), centroid, principal_moments and radii (PackedFloat64Arrays of three), inertia and principal_axes (of nine, row-major), and accuracy_met and from_polyline (bools); empty on failure. Doubles, as solid.mass's are.
LengthMass.length
The length.
No class: curve.mass(accuracy) returns a Dictionary — length, length_error, centroid_error and inertia_error (floats), centroid, principal_moments and radii (PackedFloat64Arrays of three), inertia and principal_axes (of nine, row-major), and accuracy_met and from_polyline (bools); empty on failure. Doubles, as solid.mass's are.
LengthMass.length_error
An estimate of length's own error.
No class: curve.mass(accuracy) returns a Dictionary — length, length_error, centroid_error and inertia_error (floats), centroid, principal_moments and radii (PackedFloat64Arrays of three), inertia and principal_axes (of nine, row-major), and accuracy_met and from_polyline (bools); empty on failure. Doubles, as solid.mass's are.
LengthMass.centroid
The centroid of the curve's length.
No class: curve.mass(accuracy) returns a Dictionary — length, length_error, centroid_error and inertia_error (floats), centroid, principal_moments and radii (PackedFloat64Arrays of three), inertia and principal_axes (of nine, row-major), and accuracy_met and from_polyline (bools); empty on failure. Doubles, as solid.mass's are.
LengthMass.centroid_error
An estimate of the distance from centroid to the true centroid.
No class: curve.mass(accuracy) returns a Dictionary — length, length_error, centroid_error and inertia_error (floats), centroid, principal_moments and radii (PackedFloat64Arrays of three), inertia and principal_axes (of nine, row-major), and accuracy_met and from_polyline (bools); empty on failure. Doubles, as solid.mass's are.
LengthMass.inertia
The inertia tensor about the centroid, three rows of three, symmetric, products of inertia negated.
No class: curve.mass(accuracy) returns a Dictionary — length, length_error, centroid_error and inertia_error (floats), centroid, principal_moments and radii (PackedFloat64Arrays of three), inertia and principal_axes (of nine, row-major), and accuracy_met and from_polyline (bools); empty on failure. Doubles, as solid.mass's are.
LengthMass.inertia_error
An estimate of every entry of inertia's error.
No class: curve.mass(accuracy) returns a Dictionary — length, length_error, centroid_error and inertia_error (floats), centroid, principal_moments and radii (PackedFloat64Arrays of three), inertia and principal_axes (of nine, row-major), and accuracy_met and from_polyline (bools); empty on failure. Doubles, as solid.mass's are.
LengthMass.principal_moments
The tensor's eigenvalues, ascending.
No class: curve.mass(accuracy) returns a Dictionary — length, length_error, centroid_error and inertia_error (floats), centroid, principal_moments and radii (PackedFloat64Arrays of three), inertia and principal_axes (of nine, row-major), and accuracy_met and from_polyline (bools); empty on failure. Doubles, as solid.mass's are.
LengthMass.principal_axes
Their axes, unit and right-handed, row i the axis of moment i.
No class: curve.mass(accuracy) returns a Dictionary — length, length_error, centroid_error and inertia_error (floats), centroid, principal_moments and radii (PackedFloat64Arrays of three), inertia and principal_axes (of nine, row-major), and accuracy_met and from_polyline (bools); empty on failure. Doubles, as solid.mass's are.
LengthMass.radii
The radius of gyration about each principal axis, sqrt(principal_moments[i] / length).
No class: curve.mass(accuracy) returns a Dictionary — length, length_error, centroid_error and inertia_error (floats), centroid, principal_moments and radii (PackedFloat64Arrays of three), inertia and principal_axes (of nine, row-major), and accuracy_met and from_polyline (bools); empty on failure. Doubles, as solid.mass's are.
LengthMass.accuracy_met
Every error is within the accuracy asked of its scale.
No class: curve.mass(accuracy) returns a Dictionary — length, length_error, centroid_error and inertia_error (floats), centroid, principal_moments and radii (PackedFloat64Arrays of three), inertia and principal_axes (of nine, row-major), and accuracy_met and from_polyline (bools); empty on failure. Doubles, as solid.mass's are.
LengthMass.from_polyline
The curve was a sampled polyline: exact for its points and not for whatever they were sampled from.
No class: curve.mass(accuracy) returns a Dictionary — length, length_error, centroid_error and inertia_error (floats), centroid, principal_moments and radii (PackedFloat64Arrays of three), inertia and principal_axes (of nine, row-major), and accuracy_met and from_polyline (bools); empty on failure. Doubles, as solid.mass's are.
CadaclysmSectionCurve
class CadaclysmSectionCurve extends RefCounted
One curve of CadaclysmSolid.section_curves() or CadaclysmSolid.contour_curves().
CadaclysmSectionCurve.curve
var curve: CadaclysmNurbsCurve # read-only
The curve, a CadaclysmNurbsCurve; its CadaclysmNurbsCurve.fit_error is error.
CadaclysmSectionCurve.plane
var plane: int # read-only
The contour plane it lies in, by index; 0 for a single section.
CadaclysmSectionCurve.exact
var exact: bool # read-only
Every piece of it was an exact curve: a line, circle, ellipse or NURBS crossing, or a face's own edge.
CadaclysmNurbsCurve
class CadaclysmNurbsCurve extends RefCounted
A curve in space to model with — always a NURBS, so a line, an arc or a conic is an exact rational one. NurbsCurve(points, degree=3, weights=None, knots=None) builds one from its control points (degree 1 to 7; weights positive, one per point; the full knot vector, non-decreasing, or None for clamped and uniform); CadaclysmNurbsCurve.through(), CadaclysmNurbsCurve.fit(), CadaclysmNurbsCurve.from_edge(), CadaclysmNurbsCurve.isocurve() and CadaclysmNurbsCurve.blend() build the rest. Immutable: every edit returns a new curve. Not CadaclysmCurve, the plain data an edge's curve is copied out as.
A face is its whole surface here: projecting onto, pulling to and crossing a face ignore its trims, so a curve projected past a face's edge lands on the surface's continuation. A curve projected or pulled onto a face is a 3D curve fitted through points on the surface, within the tolerance asked (CadaclysmNurbsCurve.fit_error says how close it came), not a curve in the face's parameters. Every refusal names the C call, e.g. nurbs_curve_trimmed: ....
CadaclysmNurbsCurve.through()
static func through(points: Variant, degree: int = 3, closed: bool = false, start_tangent: PackedFloat64Array = PackedFloat64Array(), end_tangent: PackedFloat64Array = PackedFloat64Array()) -> CadaclysmNurbsCurve
The curve of degree through points in order, chord-length parametrised. closed=True closes it back to the first point, smooth across the seam (C^(degree-1)); an open curve may leave along start_tangent and arrive along end_tangent (directions; their length does not matter). Too few points for the degree, a point repeating the one before it, or a closed curve given end tangents, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsCurve.fit()
static func fit(points: Variant, degree: int = 3, tolerance: float = 1e-3) -> CadaclysmNurbsCurve
A curve of degree within tolerance of every point, through the first and the last (least squares, growing its control points until the tolerance is met); its CadaclysmNurbsCurve.fit_error is the largest distance from a point to it. A tolerance not positive returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsCurve.fair()
static func fair(points: Variant, degree: int = 5, tolerance: float = 1e-3, no_inflection: PackedFloat64Array = PackedFloat64Array()) -> CadaclysmNurbsCurve
The smoothest curve of degree (3 to 7) within tolerance of every point, through the first and the last: least squares plus the curvature's derivative squared, weighed as heavily as the tolerance allows. Where CadaclysmNurbsCurve.fit() follows the points' noise, this spends the tolerance on a calm curvature comb (CadaclysmNurbsCurve.comb()) — a design line traced off a drawing comes back fair. no_inflection=True keeps the curvature from turning over anywhere; a pair of point indices (i, j) (fractions between points, None an open end) only between those points. Its CadaclysmNurbsCurve.fit_error is the largest distance from a point to it. A degree outside 3 to 7, or a hold no curve within the tolerance can keep, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsCurve.faired()
func faired(degree: int = 5, tolerance: float = 1e-3, no_inflection: PackedFloat64Array = PackedFloat64Array()) -> CadaclysmNurbsCurve
This curve faired: the smoothest curve of degree within tolerance of it, from its start to its end, as CadaclysmNurbsCurve.fair() makes one from points; the no_inflection pair is this curve's own parameters here. Its CadaclysmNurbsCurve.fit_error is the largest distance found between the two.
CadaclysmNurbsCurve.from_edge()
static func from_edge(solid: CadaclysmSolid, edge: Variant) -> CadaclysmNurbsCurve
Edge edge of solid (an CadaclysmEdge or its index) as an exact NURBS over the edge's own span of its curve, running the way the edge runs. An edge with no exact curve returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsCurve.isocurve()
static func isocurve(solid: CadaclysmSolid, face: int, along_u: bool, at: float) -> CadaclysmNurbsCurve
The isocurve of face face of solid's surface: along u at v = at when along_u, else along v at u = at. NURBS faces only: a plane or a quadric face returns null, false or an empty value (the reason in Cadaclysm.last_error()), as does an at outside the surface's domain.
CadaclysmNurbsCurve.face_isocurves()
static func face_isocurves(solid: CadaclysmSolid, face: int, along_u: bool, at: float, tolerance: float = 0.0) -> Array[CadaclysmNurbsCurve]
The pieces of face face's isocurve of solid that lie inside its trims, as Rhino's TrimAwareIsoCurve, in order along it: along u at v = at when along_u, else along v at u = at. Exact on every surface kind (a sampled profile's falls back to a fit at tolerance, 0 or null the solid's own); each piece's ends are polished onto the edges they meet, and its CadaclysmNurbsCurve.fit_error is the larger of its fit error and those ends' distance from their edges. A periodic seam is crossed in one piece; an at the face never reaches gives an empty list. CadaclysmSolid.face_iso_intervals() gives the same pieces as parameter intervals.
CadaclysmNurbsCurve.spiral()
static func spiral(axis_point: Variant, axis_direction: Variant, start: Variant, pitch: float, turns: float, end_radius: float = f64.NAN) -> CadaclysmNurbsCurve
A helix or spiral as a curve, as Rhino's NurbsCurve.CreateSpiral: about axis (a point on it and its direction, which need not be unit) from start, turning the right-hand way about the direction and climbing pitch along it each turn (negative climbs the other way, 0 is flat) for turns turns, its radius running linearly with the angle from start's distance from the axis to end_radius (null: the same, a helix). A start on the axis takes revolve's reference direction. A C2 quintic, 16 spans a turn, through the exact spiral at every span end; its CadaclysmNurbsCurve.fit_error is its largest distance from the exact spiral. An axis direction zero or not finite, turns not positive and finite, pitch not finite, or both radii zero, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsCurve.blend()
static func blend(a: CadaclysmNurbsCurve, a_end: bool, b: CadaclysmNurbsCurve, b_end: bool, continuity: int = 2, bulge: float = 1.0) -> CadaclysmNurbsCurve
The curve bridging a (at its end when a_end, else its start) to b (at its end when b_end, else its start), leaving a and arriving at b along their tangents: continuity 1 matches position and tangent (a cubic), 2 also the curvature (a quintic). bulge (positive, 1 usual) scales how far the tangents reach. Two ends at the same point returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsCurve.join()
static func join(curves: Array, tolerance: float = 1e-6) -> CadaclysmNurbsCurve
curves joined end to end into one curve, as Rhino's JoinCurves: in the order given, each turned where needed so its start meets the previous one's end (the first one too, when only its start meets the second), within tolerance, and the joint placed at the midpoint of the two ends. All are raised to the highest degree among them and each runs over k..k + 1 of the result, joined C0 — a corner stays a corner; a rational curve (an arc) keeps its points exactly. One curve gives a copy. No curves, or two ends further apart than tolerance, returns null, false or an empty value (the reason in Cadaclysm.last_error()), naming the two curves and the gap.
CadaclysmNurbsCurve.closest_point()
func closest_point(p: Variant, max_distance: float = f64.NAN) -> CadaclysmCurveFoot
The CadaclysmCurveFoot nearest p over the curve's whole domain: its parameter t, the point, and unique — false where another point of the curve is as near (a point on a circle's axis) and point is a pick among them. Exact. null where it lies beyond max_distance (none, NaN or infinite: no limit, the same answer as with none). A point not finite or a negative max_distance returns null, false or an empty value (the reason in Cadaclysm.last_error()).
max_distance defaults to NaN, no limit; where the call takes a tolerance it defaults to NaN too, the model's policy. null beyond it leaves Cadaclysm.last_error() empty; a refusal is null with the reason there.
CadaclysmNurbsCurve.closest_points()
func closest_points(other: CadaclysmNurbsCurve, max_distance: float = f64.NAN) -> CadaclysmCurvePair
The nearest points of this curve and other, as a CadaclysmCurvePair — side a this curve, distance 0 where they cross, and among equal distances the smallest t_a, then t_b — or null where they lie farther apart than max_distance (none, NaN or infinite: no limit). Exact. A negative max_distance returns null, false or an empty value (the reason in Cadaclysm.last_error()).
max_distance defaults to NaN, no limit; where the call takes a tolerance it defaults to NaN too, the model's policy. null beyond it leaves Cadaclysm.last_error() empty; a refusal is null with the reason there.
CadaclysmNurbsCurve.closest_object()
func closest_object(items: Array, max_distance: float = f64.NAN, tolerance: float = f64.NAN) -> CadaclysmNearestObject
The item of items nearest to this curve, as a CadaclysmNearestObject, or null where none lies within max_distance (none, NaN or infinite: no limit) or items is empty. Each item is a CadaclysmSolid, a CadaclysmNurbsCurve, a CadaclysmProjector, a CadaclysmTriangleMesh or a CadaclysmNurbsSurface (both answered exactly) or a point. Items are asked in order, each with the best distance so far as its limit, and once one touches the curve no later one is asked; equal distances go to the earlier item. tolerance (none, 0 or NaN: each solid's effective tolerance) sizes each solid's search; a projector keeps its own, and its lock is held for the whole curve query, so other threads asking it wait. An item of none of those kinds or a point not finite (each naming item <i>), a negative max_distance, a negative or infinite tolerance, or a body's own refusal returns null, false or an empty value (the reason in Cadaclysm.last_error()).
max_distance defaults to NaN, no limit; where the call takes a tolerance it defaults to NaN too, the model's policy. null beyond it leaves Cadaclysm.last_error() empty; a refusal is null with the reason there.
CadaclysmNurbsCurve.tween()
func tween(other: CadaclysmNurbsCurve, count: int, method: String = "matching", samples: int = 0, align: bool = true, tolerance: float = 0.0) -> Array[CadaclysmNurbsCurve]
count curves blending evenly from this curve to other, as Rhino's CreateTweenCurves family: the i-th at the fraction (i + 1) / (count + 1). method says how the two are brought to one structure first. "plain" blends control point by control point and weight by weight, so the curves must already share degree, control-point count and knots (returns null, false or an empty value (the reason in Cadaclysm.last_error()) otherwise; Rhino answers with a curve that is not a blend). "matching" makes them compatible exactly, by degree elevation and knot merging, and blends in homogeneous coordinates: rational curves stay rational, and two non-rational curves blend point for point along their parameters. "sampling" divides both into samples equal pieces by arc length, blends the samples and fits a cubic through them — the robust choice for curves of very different shape; closed curves give a periodic tween. With align (the default) other is first lined up with this curve: turned to run the same way and, for closed curves, its seam moved round to match this one's start, so the tweens do not twist. Rhino's calls leave that to the caller; align=False does the same. tolerance (None: the curves' effective tolerance) decides whether a curve is closed and how closely the samples sit at their arc lengths. One curve open and the other closed returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsCurve.project_to_plane()
func project_to_plane(origin: Variant, normal: Variant, direction: PackedFloat64Array = PackedFloat64Array()) -> CadaclysmNurbsCurve
This curve projected onto the plane through origin with normal, along direction (None: the normal). Exact — the control points move, the weights stay. A direction lying in the plane returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsCurve.project_to_face()
func project_to_face(solid: CadaclysmSolid, face: int, direction: Variant, tolerance: float = 1e-3) -> CadaclysmNurbsCurve
This curve projected along direction onto face face of solid (its whole surface): sampled, each sample carried along the direction to the surface, fitted within tolerance. A sample whose ray misses the surface, or a result straying past the tolerance, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsCurve.pull_to_face()
func pull_to_face(solid: CadaclysmSolid, face: int, tolerance: float = 1e-3) -> CadaclysmNurbsCurve
This curve pulled onto face face of solid (its whole surface): each sample moved to its nearest surface point, fitted within tolerance.
CadaclysmNurbsCurve.offset_on_sheet
This curve, lying on the sheet solid (any of its faces, within ten times tolerance), offset distance along it: each sample walked that far across the sheet, square to the curve — left of its run seen from the outward side for a positive distance — over the seams of a joined sheet and onto the surface continued past its edge, and fitted within tolerance, each side of a crease apart. fit_error is the larger of the fit's error and the distance off the sheet. A curve that does not lie on the sheet returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Not in the Godot add-on yet.
CadaclysmNurbsCurve.offset()
func offset(distance: float, direction: PackedFloat64Array, tolerance: float = 0.0) -> CadaclysmNurbsCurve
This curve moved distance in space, square to its tangent and to direction, as Rhino's Curve.Offset: to the right of its run seen from the tip of direction for a positive distance, to the left for a negative one. A line, or a circular arc in a plane square to direction, offsets exactly (fit_error 0); anything else is fitted within tolerance (none: the effective tolerance), fit_error bounding the distance from the exact offset. A closed smooth curve offsets to a closed curve; a distance of 0 is a copy. A zero direction, a distance that is not finite, a corner (a kink the offset would tear at: offset a CadaclysmProfile for corner styles), a curve running along direction, or an offset that folds over (an arc's radius used up, a turn tighter than distance) returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsCurve.offset_normal_to_sheet()
func offset_normal_to_sheet(solid: CadaclysmSolid, distance: float, tolerance: float = 0.0) -> CadaclysmNurbsCurve
This curve, lying on the sheet solid (within ten times tolerance), moved distance along the sheet's normal at each of its points — off the sheet the way its faces face for a positive distance — as Rhino's OffsetNormalToSurface, and fitted within tolerance (none: the inputs' effective tolerance); fit_error bounds the distance from the exact offset. A curve off the sheet, one crossing a crease (faces whose normals differ by more than a degree), a distance that is not finite, or an offset that folds over returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsCurve.offset_tangent_to_sheet()
func offset_tangent_to_sheet(solid: CadaclysmSolid, distance: float, tolerance: float = 0.0) -> CadaclysmNurbsCurve
This curve, lying on the sheet solid (within ten times tolerance), moved distance in the sheet's tangent plane, square to the curve — along the sheet's normal crossed with the curve's tangent for a positive distance, straight rather than walked across the sheet as CadaclysmNurbsCurve.offset_on_sheet does — as Rhino's OffsetTangentToSurface. Fitted within tolerance (none: the inputs' effective tolerance); fit_error bounds the distance from the exact offset. A curve off the sheet, one crossing a crease, a distance that is not finite, or an offset that folds over returns null, false or an empty value (the reason in Cadaclysm.last_error()), as for CadaclysmNurbsCurve.offset_normal_to_sheet().
CadaclysmNurbsCurve.pull_back()
func pull_back(solid: CadaclysmSolid, face: int, tolerance: float = 1e-3) -> CadaclysmNurbsCurve
This curve, lying on face face of solid within tolerance, read back into the face's surface parameters, as Rhino's Pullback: a uv curve — a curve in the z = 0 plane whose x is u and y is v — over this curve's own domain, its point at t paired with this curve's at t. The face is its whole surface; its trims are not read. Exact where the curve runs along a parameter line and in a plane, fitted elsewhere. Across a periodic surface's seam the uv curve runs on rather than jumping a period; where the curve ends at a pole (a sphere's, a cone's apex) it meets the pole line square, and where it passes over one it gains a run along the pole line, so past that point its parameter no longer pairs with this curve's. fit_error is the deviation reached. A curve standing off the surface past the tolerance returns null, false or an empty value (the reason in Cadaclysm.last_error()), naming where and how far.
CadaclysmNurbsCurve.push_up()
func push_up(solid: CadaclysmSolid, face: int, tolerance: float = 1e-3) -> CadaclysmNurbsCurve
This uv curve (z = 0: x is u, y is v) carried out through face face's surface of solid, as Rhino's Pushup: a curve in space over the same domain within tolerance of the surface's points along it — exact on a plane and along a parameter line (the surface's own circle, ruling or isocurve). fit_error is the deviation reached. A curve off the z = 0 plane, or one leaving a patch's domain on a side that does not wrap, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsCurve.fit_to_face()
func fit_to_face(solid: CadaclysmSolid, face: int, direction: PackedFloat64Array = PackedFloat64Array(), knots: PackedFloat64Array = PackedFloat64Array(), tolerance: float = 1e-3) -> CadaclysmNurbsCurve
This curve carried onto face face of solid and fitted to the face's surface parameter it crosses, as Rhino's FitCurveToSurface. It is projected onto the surface along direction, or pulled (each point to its nearest) where there is none; the trace must cross the face's parameter rectangle — the box its trims span in its surface's parameters — from one side to the opposite one. The result is parametrised by the parameter it crosses: at t it is over u = t (or v = t), running with it rising, over the face's range, on the surface's own knots in that direction plus knots, at the surface's degree there (at least 3) — knot-compatible with the surface's isocurves. Where it is farther than tolerance from the trace, knots are added halfway along the spans still off; fit_error bounds the distance from the exact trace. A trace that does not cross, one that turns back, or a knot outside the range returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsCurve.through_on_face()
static func through_on_face(solid: CadaclysmSolid, face: int, points: Variant, closed: bool = false, tolerance: float = 1e-3) -> CadaclysmNurbsCurve
A smooth curve through points lying on face face of solid, as Rhino's InterpolatedCurveOnSurface: each point's nearest foot on the face's surface, interpolated in its parameters (cubic, chord-length) and carried out through it within tolerance. Feet either side of a seam are joined the short way. closed runs back to the first point, smooth across the join; a ring round a cylinder closes. A point farther than tolerance from the surface returns null, false or an empty value (the reason in Cadaclysm.last_error()), naming its index.
CadaclysmNurbsCurve.through_uv_on_face()
static func through_uv_on_face(solid: CadaclysmSolid, face: int, uvs: Variant, closed: bool = false, tolerance: float = 1e-3) -> CadaclysmNurbsCurve
A smooth curve through the surface parameters uvs ((u, v) pairs) of face face of solid, as Rhino's InterpolatedCurveOnSurfaceUV: interpolated in the parameters (cubic, chord-length) and carried out through the surface within tolerance. closed runs back to the first point; a ring whose last point is a whole period short of the first winds round a periodic surface and closes. A ring winding both parameters at once, or fewer points than the curve needs, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsCurve.short_path()
static func short_path(solid: CadaclysmSolid, face: int, a: Variant, b: Variant, tolerance: float = 1e-3) -> CadaclysmNurbsCurve
The shortest path on face face's surface of solid from the surface parameters a to b ((u, v) pairs), as Rhino's ShortPath, within tolerance: a geodesic — the straight run between them in the parameters relaxed until its length settles, tried a period either way round a periodic surface and the shortest kept. It is the shortest among those starts: the quadrics' and a gentle patch's shortest path, while a hill between the points may hide a shorter way round. The face's trims are not read. fit_error is the deviation reached. Two equal points returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsCurve.is_isoparametric()
func is_isoparametric(solid: CadaclysmSolid, face: int, tolerance: float = 0.0) -> Variant
Whether this curve runs along one of face face's isocurves of solid, as Rhino's IsIsoparametric: ("u", v) along u with v held, ("v", u) along v with u held, or null — neither, or not on the face. Read back into the face's parameters at tolerance (0 or null the solid's own), it is an isocurve where its parameter spread across the held direction is within tolerance in space.
CadaclysmNurbsCurve.reverse()
func reverse() -> CadaclysmNurbsCurve
The same curve run the other way over the same domain.
CadaclysmNurbsCurve.trim()
func trim(t0: float, t1: float) -> CadaclysmNurbsCurve
The part from t0 to t1 (t0 < t1, both inside the domain), over t0..t1.
CadaclysmNurbsCurve.extend()
func extend(length: float, at_start: bool = false) -> CadaclysmNurbsCurve
This curve continued length past its end (or its start, at_start=True) along its own end polynomial: position, tangent and curvature there unchanged, and every old parameter still names its old point — the domain grows on that side only.
CadaclysmNurbsCurve.elevate()
func elevate(by: int = 1) -> CadaclysmNurbsCurve
The same curve at degree degree + by (the result at most 12).
CadaclysmNurbsCurve.insert_knot()
func insert_knot(t: float, times: int = 1) -> CadaclysmNurbsCurve
The same curve, exactly, with the knot t (strictly inside the domain) inserted times times (Boehm insertion; Rhino's Knots.InsertKnot): more control points, every point of the curve kept. A t outside the domain, a times of 0, or a multiplicity there past the degree, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsCurve.refine_knots()
func refine_knots(knots: PackedFloat64Array) -> CadaclysmNurbsCurve
The same curve, exactly, with every knot of knots inserted (non-decreasing, each strictly inside the domain, no multiplicity past the degree).
CadaclysmNurbsCurve.remove_knot()
func remove_knot(t: float, times: int = 1, tolerance: float = 0.0) -> Variant
Up to times copies of the inner knot t removed (Rhino's Knots.RemoveKnots), each only while the curve stays within tolerance of itself (none, 0 or NaN: the curve's effective tolerance): the curve and how many went — 0, and an unchanged copy, where none could (a knot holding a corner). A t that is not an inner knot, or a negative tolerance, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Answers [curve or surface, removed], or null on a refusal.
CadaclysmNurbsCurve.make_compatible()
static func make_compatible(curves: Array) -> Array[CadaclysmNurbsCurve]
curves made compatible (Rhino's MakeCompatible): each reparametrised to [0, 1], raised to the highest degree among them and refined with every other's knots, so all share one degree, one knot vector and one control-point count — each the same point set it was, rational curves exactly. The ground CadaclysmNurbsCurve.tween()'s "matching" and a loft stand on. No curves returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsCurve.reparametrize()
func reparametrize(lo: float, hi: float) -> CadaclysmNurbsCurve
The same curve over the domain [lo, hi] (lo < hi), the parameter mapped affinely (Rhino's Reparameterize).
CadaclysmNurbsCurve.make_uniform()
func make_uniform() -> CadaclysmNurbsCurve
The control points and weights over evenly spaced knots on the domain (Rhino's MakeUniform): clamped where it was clamped. The shape moves unless the knots were uniform already.
CadaclysmNurbsCurve.non_rational()
func non_rational() -> CadaclysmNurbsCurve
Every weight 1, the control points where they were (Rhino's MakeNonRational): exact where the weights were all equal, otherwise the plain B-spline of the same polygon.
CadaclysmNurbsCurve.greville_parameters()
func greville_parameters() -> PackedFloat64Array
The Greville abscissae, one per control point: each the mean of the degree knots after its first — where a control point pulls hardest, and the parameters to interpolate at.
CadaclysmNurbsCurve.greville_points()
func greville_points() -> PackedFloat64Array
The curve's points at its CadaclysmNurbsCurve.greville_parameters(), one per control point.
CadaclysmNurbsCurve.periodic()
func periodic(smooth: bool = true) -> CadaclysmNurbsCurve
A periodic curve (seamless, C^(degree-1) all round) of the same degree (Rhino's CreatePeriodicCurve); a closed curve's repeated last control point is dropped first. smooth false keeps the control points and weights and wraps the polygon over uniform knots on [0, m] for m points; true (the default) keeps close to the curve instead: a periodic curve through its Greville points on [0, 1]. Fewer than degree + 1 distinct control points returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsCurve.mean()
func mean(other: CadaclysmNurbsCurve, tolerance: float = 0.0) -> CadaclysmNurbsCurve
The curve halfway between this one and other (Rhino's CreateMeanCurve): other lined up with this one first (CadaclysmNurbsCurve.lined_up_with()), the two made compatible exactly and averaged — two arcs about one centre give the arc of the mean radius. tolerance (none, 0 or NaN: the curves' effective tolerance) decides whether each is closed. One curve closed and the other open returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsCurve.lined_up_with()
func lined_up_with(other: CadaclysmNurbsCurve, tolerance: float = 0.0) -> CadaclysmNurbsCurve
This curve turned to run with other — an open one reversed where its ends lie crosswise to other's, a closed one reversed where it goes round the other way and its seam moved to match — the same point set either way; unchanged where one is closed and the other open.
CadaclysmNurbsCurve.directions_match()
func directions_match(other: CadaclysmNurbsCurve, tolerance: float = 0.0) -> bool
Whether other runs the same way as this curve (Rhino's DoDirectionsMatch): two closed curves going round the same way, otherwise other's ends lying along this one's rather than crosswise. A closed curve with no area returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsCurve.conic_type()
func conic_type(tolerance: float = 0.0) -> Variant
Which conic this curve is, read from its points within tolerance (none, 0 or NaN: its effective tolerance; Rhino's GetConicSectionType): "circle", "ellipse", "hyperbola" or "parabola", or null for a curve that is none (straight, not planar, off every conic). Any exact form reads the same: a circle raised to degree 5 is a circle. A negative tolerance returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Answers the word, or null for none (then Cadaclysm.last_error() is empty); null with the reason there on a refusal.
CadaclysmNurbsCurve.transform()
func transform(t: Variant) -> CadaclysmNurbsCurve
This curve through the affine map t (a CadaclysmTransform or 16 numbers): its control points mapped, weights and knots kept — exact. A singular map, a projection, is allowed.
CadaclysmNurbsCurve.control_points
var control_points: PackedFloat64Array # read-only
The control points, as (x, y, z) triples.
CadaclysmNurbsCurve.weights
var weights: PackedFloat64Array # read-only
One weight per control point; all 1 for a plain B-spline.
CadaclysmNurbsCurve.knots
var knots: PackedFloat64Array # read-only
The full knot vector, len(control_points) + degree + 1 values.
CadaclysmNurbsCurve.domain
var domain: PackedFloat64Array # read-only
The parameter domain (lo, hi).
CadaclysmNurbsCurve.is_rational
var is_rational: bool # read-only
Whether the weights differ: a true NURBS rather than a plain B-spline.
CadaclysmNurbsCurve.is_closed
var is_closed: bool # read-only
Whether the curve ends where it starts (to 1e-10 of its size).
CadaclysmNurbsCurve.point()
func point(t: float) -> PackedFloat64Array
The point at parameter t; a t outside the domain returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsCurve.derivatives()
func derivatives(t: float, order: int = 2) -> Array[PackedFloat64Array]
The point and its derivatives at t up to order (at most 8): [C, C', C'', ...].
CadaclysmNurbsCurve.curvature()
func curvature(t: float) -> CadaclysmCurvature
The CadaclysmCurvature and Frenet frame at t. A point where the curve has no tangent returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsCurve.length()
func length(accuracy: float = 0.0) -> CadaclysmLength
The curve's length as a CadaclysmLength, to the relative accuracy (0 asks for the default).
CadaclysmNurbsCurve.length_between()
func length_between(t0: float, t1: float, accuracy: float = 0.0) -> CadaclysmLength
The length over [t0, t1] of the curve's parameter as a CadaclysmLength, as Rhino's GetLength(subdomain), to the relative accuracy (0 asks for the default). A range running backwards or outside the domain returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsCurve.point_at_length()
func point_at_length(s: float, accuracy: float = 0.0) -> CadaclysmAt
The point at arc length s from the start, as an CadaclysmAt (segment empty).
CadaclysmNurbsCurve.point_at_normalized_length()
func point_at_normalized_length(f: float, accuracy: float = 0.0) -> CadaclysmAt
The point at the fraction f of the curve's length, f in [0, 1], as an CadaclysmAt, as Rhino's PointAtNormalizedLength (its parameter is NormalizedLengthParameter's answer). 0 is the start and 1 the end exactly.
CadaclysmNurbsCurve.points_at_normalized_lengths()
func points_at_normalized_lengths(fractions: PackedFloat64Array, accuracy: float = 0.0) -> Array[CadaclysmAt]
The points at each fraction of fs of the curve's length, as CadaclysmAt samples in the order given, over one measure of it, as Rhino's NormalizedLengthParameters.
CadaclysmNurbsCurve.divide_by_count()
func divide_by_count(n: int, accuracy: float = 0.0) -> Array[CadaclysmAt]
The curve in n pieces of equal arc length: n + 1 CadaclysmAt samples, n for a closed curve (its start not repeated).
CadaclysmNurbsCurve.divide_by_length()
func divide_by_length(step: float, accuracy: float = 0.0) -> Array[CadaclysmAt]
Samples every step of arc length from the start; the last piece is whatever is left, and a closed curve never repeats its start.
CadaclysmNurbsCurve.divide_equidistant()
func divide_equidistant(distance: float) -> Array[CadaclysmAt]
Points along the curve each distance in a straight line from the one before, as Rhino's DivideEquidistant, each an CadaclysmAt: the first the curve's start, each next the first point further on that is distance from the last, until none is; a closed curve does not wrap. Each point's error is how far its chord is from distance.
CadaclysmNurbsCurve.divide_as_contour()
func divide_as_contour(start: Variant, end: Variant, interval: float) -> Array[CadaclysmAt]
Where the curve crosses the planes square to end - start through start and every interval on towards end, as Rhino's DivideAsContour, each an CadaclysmAt in the curve's parameter order; a plane the curve lies in gives none. Each point's error is its distance from its plane.
CadaclysmNurbsCurve.mass()
func mass(accuracy: float = 0.0) -> Dictionary
The curve's length mass properties per unit length density as a LengthMass, as Rhino's LengthMassProperties, to the relative accuracy (0 asks for the default).
CadaclysmNurbsCurve.plane_hits()
func plane_hits(origin: Variant, normal: Variant) -> Array[CadaclysmAt]
Where the curve crosses the plane through origin with normal, in parameter order, each an CadaclysmAt whose error is the point's distance from the plane. A curve lying in the plane returns null, false or an empty value (the reason in Cadaclysm.last_error()); a touch that does not cross is not listed.
CadaclysmNurbsCurve.face_hits()
func face_hits(solid: CadaclysmSolid, face: int, tolerance: float = 1e-3) -> Array[CadaclysmAt]
Where the curve crosses face face of solid (its whole surface), within tolerance of it, in parameter order, each an CadaclysmAt whose error is the point's distance from the surface. A touch that does not cross is not listed.
CadaclysmNurbsCurve.comb()
func comb(n: int = 64, scale: float = 1.0) -> PackedVector3Array
A curvature comb to draw: at n + 1 even parameters, the curve point and that point moved by -scale * kappa * normal, out of the bend. Straight stretches give zero teeth.
CadaclysmNurbsCurve.inflections()
func inflections() -> Array[CadaclysmAt]
Where the curvature turns from one side to the other, in parameter order, each an CadaclysmAt (error zero): the comb flipping sides. Empty for a curve that bends one way only — what a test of a design line asks for.
CadaclysmNurbsCurve.knot_continuity()
func knot_continuity() -> CadaclysmKnotContinuity
How smoothly the curve runs through its own knots (a closed curve's seam among them), as a CadaclysmKnotContinuity: the largest turn of its tangent and the largest jump of its curvature.
CadaclysmNurbsCurve.fit_error
var fit_error: Variant # read-only
On a curve from CadaclysmNurbsCurve.fit(), CadaclysmNurbsCurve.fair(), CadaclysmNurbsCurve.faired(), CadaclysmNurbsCurve.spiral(), CadaclysmNurbsCurve.face_isocurves(), a CadaclysmSectionCurve, CadaclysmNurbsCurve.project_to_face(), CadaclysmNurbsCurve.pull_to_face(), an offset (CadaclysmNurbsCurve.offset(), CadaclysmNurbsCurve.offset_normal_to_sheet(), CadaclysmNurbsCurve.offset_tangent_to_sheet()) or one of the curves on a face (CadaclysmNurbsCurve.pull_back(), CadaclysmNurbsCurve.push_up(), CadaclysmNurbsCurve.fit_to_face(), CadaclysmNurbsCurve.through_on_face(), CadaclysmNurbsCurve.through_uv_on_face(), CadaclysmNurbsCurve.short_path()), the largest distance found between it and what it was fitted to; null on any other.
create Godot only
static func create(points: Variant, degree: int = 3, weights: PackedFloat64Array = PackedFloat64Array(), knots: PackedFloat64Array = PackedFloat64Array()) -> CadaclysmNurbsCurve
Python's NurbsCurve(points, degree=3, weights=None, knots=None): weights and knots are PackedFloat64Arrays, empty for none. (new is GDScript's own, so the constructor is create.) The curve keeps the kernel's doubles: a point it answers is a PackedFloat64Array of three, control_points three doubles each in a row (as CadaclysmCurve's poles), domain [lo, hi], derivatives an Array of such points and comb a PackedVector3Array of segment pairs to draw (floats). An optional vector argument (start_tangent, direction, up) is a PackedFloat64Array, empty for none; an optional radius is NAN for none; tween's samples is 0 for none. A refusal returns null (an empty array for a list or a point) with the reason in Cadaclysm.last_error().
HealthReport
What is wrong with a body, as plain data: what CadaclysmSolid.health() returns. Nothing in it moves the body. It lists the free edges (the sides only one face bounds) and the wires they chain into, the features below the tolerance, the loose edges, what sewing would join and leave, and, if asked for, where the body's mesh cracks. The tolerance is an absolute length, as Rhino's model tolerance is; it is reported back as used.
No class: health returns a Dictionary with these keys — the rows as Arrays of Dictionaries, cracks a Dictionary or null.
HealthReport.tolerance
The length below which a feature is small and a gap closes, as used: by default 1e-4 times the body's diagonal. A value that is not finite and positive (NaN, infinite, zero or negative) takes the default.
The tolerance key.
HealthReport.extent
The body's diagonal, the length the default tolerance is a fraction of.
The extent key.
HealthReport.free_edges
The free edges, as FreeEdge rows, each wire's edges together and in order.
The free_edges key.
HealthReport.loose_edges
How many shared edges are loose: the two faces' sides along the edge lie further apart than the larger of the tolerance the body recorded for the edge and the one given.
The loose_edges key.
HealthReport.sew_pairs
How many pairs of free edges CadaclysmBrep.sew (or CadaclysmSolid.join_sheets()) would join: those with shared_ends 2.
The sew_pairs key.
HealthReport.cracks
Where the body's mesh cracks, as a Cracks; null unless the call asked for the mesh. Cracks are only counted on a closed body: for an open one the census is empty by design, so watertight false beside no edges means "not asked", not "nothing found".
The cracks key.
HealthReport.worst_gap
The widest gap between a free edge and its partner. A rim has no true partner, so it reads as a gap the size of the part.
The worst_gap key.
HealthReport.wire_edges
The free edges of one wire, by its number in wires, in order.
No helper: a Dictionary has no methods, so it is free_edges.slice(w.first, w.first + w.count) for wire w.
FreeEdge
One free edge: a side only one face bounds, with its nearest partner. The partner is the nearest free edge other than a neighbour on its own wire, so the rim of a sheet reads as a gap the size of the part rather than as a crack, and a real seam reads as a small gap. The partner is a row index into free_edges.
No class: each row of free_edges is a Dictionary with these keys; edge and partner are -1 for none.
FreeEdge.partner
The nearest free edge across the gap, as an index into free_edges; null if there is none.
The partner key; -1 for none.
FreeWire
A chain of free edges end to end.
No class: each row of wires is a Dictionary with these keys.
FreeWire.first
The row of free_edges it starts at: its edges are the rows first to first + count.
The first key.
SmallFeature
Something below the tolerance.
No class: each row of small is a Dictionary with these keys, kind a String.
SmallFeature.kind
What it is: short_edge, collapsed_edge, sliver_face, tiny_face, tiny_body or small_hole (an inner loop whose edges are all free, below the tolerance in area or width: a pinhole in an open sheet; a hole with walls is not one).
The kind key.
Cracks
What a mesh of the body shows, asked for with mesh=True: the call meshes the body. Only a closed body is counted: an open one's census is empty by design, as its rim is not a crack.
No class: a Dictionary with these keys, edges a PackedInt64Array; the report's cracks is null unless mesh was asked for.
HealReport
What CadaclysmSolid.heal() did, as plain data: the fixes it made, the small features it left and why, and the body's health before and after at the tolerance it healed at. Indices are the input body's.
No class: heal returns a Dictionary {body, report} — body the new body, report a Dictionary with these keys.
HealReport.tolerance
The tolerance it healed at, as used: by default 1e-4 times the body's diagonal.
The tolerance key.
HealReport.moved
The furthest any trim the result keeps moved, measured: the edited trims against the originals. Not the same measure as a HealFix's moved, which is how far that fix's merged vertices moved: a curve can move further than its ends, and the trims of a dropped edge are not measured at all, so either can be the larger.
The moved key.
HealReport.guarded
Whether the guard refused a fix: the full result was worse (less closed, more free or non-manifold edges, or no faces left), so the face pass's fixes were refused and the rest kept, or, if that was still worse, every fix was refused and the body came back as it was. Refused fixes are listed as body_guard.
The guarded key.
HealReport.fixes
What was done, as HealFix rows, in the order it was done. A short edge removed as part of a face is that face's fix and is not listed again.
The fixes key.
HealReport.nonmanifold_before
The input's edges three or more faces share.
The nonmanifold_before key.
HealFix
One small feature removed.
No class: each row of fixes is a Dictionary with these keys.
HealFix.moved
How far the vertices this fix merged moved. The report's own moved is a second measure, how far any surviving trim moved, measured; either can be the larger.
The moved key.
HealRefusal
One small feature left, and why.
No class: each row of refused is a Dictionary with these keys, why a String.
HealRefusal.why
would_empty_loop (removing the edge would leave a loop with no trims: the face pass's case), closed (both ends already one vertex: a tiny closed curve), seam (one face uses the edge twice), chain (the vertices to merge span more than the tolerance), neighbours_part (a sliver's two long sides part by more than the tolerance), uneven (a sliver's long edges are not two, one per side), non_manifold (a sliver side three or more trims share), has_holes (the sliver or tiny face has inner loops), body_guard (the guard refused the fix), toggled (its kind switched off) or unsupported (a tiny body, which healing never removes).
The why key.
RecognizeReport
What CadaclysmSolid.recognize() did, as plain data: the faces and edges given an analytic kind, the faces left free-form and why, and the tolerance it fitted to. Faces and edges are numbered as in the body, before and after alike.
No class: recognize returns a Dictionary {body, report} — body the new body, report a Dictionary with these keys, the rows as Arrays of Dictionaries.
RecognizeReport.tolerance
The tolerance it fitted to, as used: by default 1e-6 of the body's extent.
The tolerance key.
RecognizeReport.edges
The edges whose curve was given an analytic kind, as RecognizedEdge rows, in edge order.
The edges key.
RecognizeReport.worst_face
The furthest any face taken lies from its analytic surface; 0 when none was taken.
The worst_face key.
RecognizeReport.worst_edge
The furthest any edge taken lies from its analytic curve; 0 when none was taken.
The worst_edge key.
RecognizedFace
One face given an analytic kind.
No class: each row of faces is a Dictionary with these keys, kind a String.
RecognizedFace.deviation
The furthest any sample of the face or point of its edges lies from the analytic surface.
The deviation key.
RecognizeRefusal
One face left free-form, and why.
No class: each row of refused is a Dictionary with these keys, why a String; closest is NAN for none.
RecognizeRefusal.why
no_kind (no kind fits within the tolerance), mixed_normals (its normals point both ways), parameter_trims (a trim in its surface's parameters could not be lifted to space) or too_few_samples.
The why key.
RecognizeRefusal.closest
For no_kind, the deviation of the kind that came closest; null otherwise.
The closest key; NAN for none (Godot has no null number).
RecognizedEdge
One edge whose curve was given an analytic kind.
No class: each row of edges is a Dictionary with these keys, kind a String.
RecognizedEdge.deviation
The furthest any point of the curve or the edge lies from the analytic curve.
The deviation key.
CadaclysmJoinReport
class CadaclysmJoinReport extends RefCounted
What CadaclysmSolid.join_sheets() did.
CadaclysmJoinReport.sewn
var sewn: int # read-only
Edges sewn: each is two naked edges become one shared edge.
CadaclysmJoinReport.worst_gap
var worst_gap: float # read-only
The widest gap between two sewn edges; 0 where every edge met exactly.
CadaclysmJoinReport.naked_before
var naked_before: int # read-only
Edges bordered by one face before the sewing.
CadaclysmJoinReport.naked_after
var naked_after: int # read-only
Edges bordered by one face after it: 0 for a closed result.
CadaclysmJoinReport.refused
var refused: int # read-only
Groups of naked edges sharing both ends that were left apart: too far apart, or three or more.
CadaclysmJoinReport.closed
var closed: bool # read-only
Whether the result is closed — every edge bordered twice — and so a solid.
CadaclysmSymmetryReport
class CadaclysmSymmetryReport extends RefCounted
What CadaclysmSolid.mirror_join() did, and how well the seam on the plane meets. The curvature is the largest difference of the two sides' normal curvatures in any one direction: across a mirror the curvature square to the seam is always equal, and what can differ is the twist along it.
CadaclysmSymmetryReport.seams
var seams: int # read-only
Edges on the plane, each one face of the half and one of its mirror.
CadaclysmSymmetryReport.squared
var squared: int # read-only
Faces of the half squared to the plane.
CadaclysmSymmetryReport.moved
var moved: float # read-only
The furthest any control point moved squaring them.
CadaclysmSymmetryReport.gap
var gap: float # read-only
The seam's largest gap between the two sides (G0).
CadaclysmSymmetryReport.angle
var angle: float # read-only
The seam's largest angle between the two sides' normals, in radians (G1).
CadaclysmSymmetryReport.curvature
var curvature: float # read-only
The seam's largest difference of normal curvature in any one direction (G2).
CadaclysmSymmetryReport.naked
var naked: int # read-only
Naked edges left on the body: the half's own boundary off the plane, and any edge on it with no mirror to sew to.
CadaclysmPatternReport
class CadaclysmPatternReport extends RefCounted
What CadaclysmSolid.pattern() or CadaclysmSolid.pattern_feature() did.
CadaclysmPatternReport.booleans
var booleans: int # read-only
Booleans run: copies apart from each other share one.
CadaclysmPatternReport.missed
var missed: int # read-only
Copies of a feature's tool sharing no volume with the body: dropped for a cut, kept as a body of their own for a join.
CadaclysmHoleReport
class CadaclysmHoleReport extends RefCounted
What CadaclysmSolid.hole() did.
CadaclysmHoleReport.bottoms
var bottoms: PackedFloat64Array # read-only
Per hole, the distance along the axis from the point to where the bore ends, the drill point excluded: depth for a blind hole; for the others the deepest point of the material it passes, rim included.
CadaclysmHoleReport.faces_added
var faces_added: int # read-only
Faces of the result on no surface of the body.
CadaclysmHoleReport.thread_depths
var thread_depths: PackedFloat64Array # read-only
Per hole, a tapped thread's length from where it starts; empty without a thread.
CadaclysmThreadSize
class CadaclysmThreadSize extends RefCounted
One row of the thread size table (CadaclysmBlacksmith.thread_sizes(), CadaclysmBlacksmith.thread_size()): ISO metric coarse M1 .. M64, ISO metric fine M8x1 .. M64x4, UNC #1 .. 1-1/2" and UNF #0 .. 1-1/2" (ASME B1.1). Every length in millimetres; the derived figures are the basic ISO 68-1 profile's. Frozen.
CadaclysmThreadSize.family
var family: String # read-only
"iso_metric_coarse", "iso_metric_fine", "unc" or "unf".
CadaclysmThreadSize.designation
var designation: String # read-only
"M10", "M10x1.25", "1/4-20 UNC", "#10-32 UNF".
CadaclysmThreadSize.minor
var minor: float # read-only
The basic minor diameter D - 1.082532 P: the internal thread's crest.
CadaclysmThreadSize.pitch_diameter
var pitch_diameter: float # read-only
The basic pitch diameter D - 0.649519 P.
CadaclysmThreadSize.tap_drill
var tap_drill: float # read-only
D - P: the ~75 % engagement rule, not a drill chart (M6 5.0, M10 8.5).
CadaclysmThreadSize.clearance
var clearance: Dictionary # read-only
ISO 273's clearance holes by fit, {"fine": .., "medium": .., "coarse": ..}; empty for a UN row or a size ISO 273 has no row for.
CadaclysmThreadReport
class CadaclysmThreadReport extends RefCounted
What CadaclysmSolid.thread() did.
CadaclysmThreadReport.internal
var internal: bool # read-only
True for a bore's thread, false for a rod's.
CadaclysmThreadReport.start
var start: Vector3 # read-only
The point on the axis where the span begins.
CadaclysmThreadReport.direction
var direction: Vector3 # read-only
The unit direction along the axis into the span.
CadaclysmThreadReport.turns
var turns: float # read-only
The coil's turns, its run past an open end included.
CadaclysmThreadReport.faces_added
var faces_added: int # read-only
Faces of the result on no surface of the body.
CadaclysmThreadRecord
class CadaclysmThreadRecord extends RefCounted
A cosmetic thread as a face carries it (CadaclysmSolid.cosmetic_thread(), or a tapped hole not modelled).
CadaclysmThreadRecord.designation
var designation: String # read-only
The table row's designation; "" for an explicit form.
CadaclysmThreadRecord.offset
var offset: float # read-only
How far from the start end the span begins.
CadaclysmThreadRecord.reverse
var reverse: bool # read-only
True where the span starts from the face's other end.
CadaclysmPattern
class CadaclysmPattern extends Object
Placements for CadaclysmSolid.pattern() and CadaclysmSolid.pattern_feature(): lists of rigid CadaclysmTransforms, instance 0 the identity (the original). skip leaves instances out by index (Fusion's suppressed instances), 0 included. Angles are radians. A count of 0, a spacing not finite, a zero direction or axis, a skip past the count, or every instance skipped returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmPattern.rectangular()
static func rectangular(direction1: Variant, count1: int, spacing1: float, direction2: PackedFloat64Array = PackedFloat64Array(), count2: int = 1, spacing2: float = 0.0, symmetric: bool = false, skip: PackedInt64Array = PackedInt64Array()) -> Array[CadaclysmTransform]
count1 instances spacing1 apart along direction1, times count2 spacing2 apart along direction2 (null: one row); row-major, direction 1 fastest. symmetric puts count on each side of the original along each direction (2 count - 1, at offsets 0, +s, -s, +2s, ...).
Returns an Array of CadaclysmTransform, empty with the reason in Cadaclysm.last_error() when refused.
CadaclysmPattern.circular()
static func circular(axis_point: Variant, axis_direction: Variant, count: int, angle: float = TAU, symmetric: bool = false, skip: PackedInt64Array = PackedInt64Array()) -> Array[CadaclysmTransform]
count instances about the line through axis_point along axis_direction: a full turn (angle 2 pi, the default) spaces them evenly; less spreads them over angle with both ends occupied. symmetric spreads count over angle on each side; with a full turn, which has no sides, it returns null, false or an empty value (the reason in Cadaclysm.last_error()). Right-handed about the direction.
Returns an Array of CadaclysmTransform, empty with the reason in Cadaclysm.last_error() when refused.
CadaclysmPattern.along()
static func along(curve: CadaclysmNurbsCurve, count: int, spacing: float = f64.NAN, orient: String = "fixed", skip: PackedInt64Array = PackedInt64Array()) -> Array[CadaclysmTransform]
count instances along a CadaclysmNurbsCurve by arc length from its start, spacing apart, or spread over its whole length with both ends occupied (spacing null). orient "fixed" translates each copy; "path" also turns it by the curve's rotation-minimising frame from the first instance's.
Returns an Array of CadaclysmTransform, empty with the reason in Cadaclysm.last_error() when refused.
CadaclysmContinuity
class CadaclysmContinuity extends RefCounted
How well two faces meet along their sides — what CadaclysmSolid.continuity() returns. The angle ignores which way each face points; the curvature is the normal curvature square to the edge, about the first face's normal.
CadaclysmContinuity.gap_at
var gap_at: PackedFloat64Array # read-only
Where on the first side it is.
CadaclysmContinuity.angle
var angle: float # read-only
The largest angle between the faces' normals, in radians (G1).
CadaclysmContinuity.angle_at
var angle_at: PackedFloat64Array # read-only
Where on the first side it is.
CadaclysmContinuity.curvature
var curvature: float # read-only
The largest difference of normal curvature across the edge (G2).
CadaclysmContinuity.curvature_at
var curvature_at: PackedFloat64Array # read-only
Where on the first side it is.
CadaclysmContinuity.samples
var samples: int # read-only
How many points along the first side were asked.
CadaclysmKnotContinuity
class CadaclysmKnotContinuity extends RefCounted
How smoothly a curve runs through its own knots — what CadaclysmNurbsCurve.knot_continuity() returns. A curve with no inner knot, and not closed, reads zero at its start.
CadaclysmKnotContinuity.angle
var angle: float # read-only
The largest turn of the tangent at a knot, in radians (G1).
CadaclysmKnotContinuity.curvature
var curvature: float # read-only
The largest jump of the curvature vector kappa * normal at a knot (G2).
CadaclysmKnotContinuity.curvature_parameter
var curvature_parameter: float # read-only
The knot it is at.
CadaclysmKnotContinuity.curvature_at
var curvature_at: PackedFloat64Array # read-only
The point there.
CadaclysmCurvatureTurns
class CadaclysmCurvatureTurns extends RefCounted
Where a face's curvatures change sign — what CadaclysmSolid.curvature_turns() returns. A sample within a millionth of the face's size of flat is neither sign: a cylinder's patch reads no Gaussian area.
CadaclysmCurvatureTurns.gaussian_positive
var gaussian_positive: int # read-only
How many separate areas of the sample grid have a positive Gaussian curvature (a dome's).
CadaclysmCurvatureTurns.gaussian_negative
var gaussian_negative: int # read-only
How many have a negative one (a saddle's).
CadaclysmCurvatureTurns.gaussian_turns
var gaussian_turns: Array[CadaclysmAt] # read-only
The points between opposite Gaussian signs, each an CadaclysmAt: tangent the face's unit normal there, parameter its u.
CadaclysmCurvatureTurns.mean_positive
var mean_positive: int # read-only
How many separate areas have a positive mean curvature, about the face's outward normal.
CadaclysmCurvatureTurns.mean_negative
var mean_negative: int # read-only
How many have a negative one.
CadaclysmCurvatureTurns.mean_turns
var mean_turns: Array[CadaclysmAt] # read-only
The points between opposite mean signs, as gaussian_turns.
CadaclysmHighlightKink
class CadaclysmHighlightKink extends RefCounted
The worst kink of the highlight lines crossing an edge — what CadaclysmSolid.highlight_kink() returns.
CadaclysmHighlightKink.angle
var angle: float # read-only
The angle in radians, 0 to pi/2, between a highlight line on one face and the same line on the other.
CadaclysmHighlightKink.light_point
var light_point: PackedFloat64Array # read-only
A point on the straight light tube that shows it.
CadaclysmHighlightKink.light_direction
var light_direction: PackedFloat64Array # read-only
The tube's unit direction.
CadaclysmHighlightKink.samples
var samples: int # read-only
How many points along the edge were read.
CadaclysmDraftPoint
class CadaclysmDraftPoint extends RefCounted
A point of a face and the draft angle there — what CadaclysmSolid.draft_angle_at() returns.
CadaclysmDraftPoint.uv
var uv: PackedFloat64Array # read-only
The surface parameters the normal was read at; none where there are none.
CadaclysmDraftPoint.angle
var angle: float # read-only
asin(normal . d) in radians, d the unit pull: positive where the face looks partly along the pull.
raw_point and raw_normal Godot only
var raw_point: PackedFloat64Array # read-only
var raw_normal: PackedFloat64Array # read-only
CadaclysmDraftPoint.point and CadaclysmDraftPoint.normal as three doubles each, where the properties hold Vector3s of floats.
CadaclysmFaceDraft
class CadaclysmFaceDraft extends RefCounted
One face's draft over a body — what CadaclysmSolid.draft_analysis() returns, one per face. Angles in radians, areas the face's measuring mesh's.
CadaclysmFaceDraft.min
var min: float # read-only
The least draft angle over the face's samples (its triangles' centres and corners).
CadaclysmFaceDraft.area
var area: float # read-only
The face's whole area; 0 for a sliver narrower than the mesh.
CadaclysmFaceDraft.positive
var positive: float # read-only
The area whose angle is at least +threshold.
CadaclysmFaceDraft.negative
var negative: float # read-only
The area whose angle is at most -threshold.
CadaclysmFaceDraft.vertical
var vertical: float # read-only
The area within threshold of 0 either way: it needs draft.
CadaclysmFaceDraft.undercut
var undercut: float # read-only
The area whose release ray meets the body.
CadaclysmFaceDraft.kind
var kind: String # read-only
"undercut" where any area is undercut, else "positive", "negative" or "vertical" where that band holds the whole face, else "mixed".
CadaclysmSheetRule
class CadaclysmSheetRule extends RefCounted
How a sheet-metal part is made — what every sheet verb takes. Lengths in model units, the bend's neutral layer k_factor * thickness past its inner face.
CadaclysmSheetRule.bend_radius
var bend_radius: Variant # read-only
The bends' inner radius; none: the thickness, 0: a hundredth of it.
CadaclysmSheetRule.k_factor
var k_factor: float # read-only
Where the neutral layer lies, in [0, 1]; 0.44 by default.
CadaclysmSheetRule.relief
var relief: String # read-only
The bend relief cut where a flange is shorter than its edge: none, rectangular (default), round or tear.
CadaclysmSheetRule.relief_depth
var relief_depth: float # read-only
Its depth past the bend; 0: half the thickness.
CadaclysmSheetRule.corner
var corner: String # read-only
The corner relief where two bends meet: none, square, round (default) or tear.
CadaclysmSheetRule.miter_gap
var miter_gap: float # read-only
The gap between two flanges meeting at a corner; 0: a tenth of the thickness.
create Godot only
static func create(thickness: float, bend_radius: float = f64.NAN, k_factor: float = 0.44, relief: String = "rectangular", relief_width: float = 0.0, relief_depth: float = 0.0, corner: String = "round", corner_size: float = 0.0, miter_gap: float = 0.0) -> CadaclysmSheetRule
Python's SheetRule(thickness, bend_radius, k_factor, relief, relief_width, relief_depth, corner, corner_size, miter_gap), bend_radius NaN for none (the thickness), the reliefs words as in Python. null for a relief or corner word not one of theirs. (new is GDScript's own, so the constructor is create.)
CadaclysmSheetInfo
class CadaclysmSheetInfo extends RefCounted
A body read as sheet metal — what CadaclysmSolid.sheet_info() returns.
CadaclysmSheetInfo.fixed_face
var fixed_face: int # read-only
The flat broad face the reading is laid from.
CadaclysmSheetInfo.bends
var bends: Array[CadaclysmBendInfo] # read-only
Every bend, as a CadaclysmBendInfo.
CadaclysmBendInfo
class CadaclysmBendInfo extends RefCounted
One bend of a sheet body, in model space.
CadaclysmBendInfo.angle
var angle: float # read-only
The signed angle in radians: positive up from the fixed side.
CadaclysmBendInfo.axis
var axis: PackedFloat64Array # read-only
The bend's axis: a point and a unit direction.
CadaclysmBendInfo.line
var line: PackedFloat64Array # read-only
The bend's line on the mid-thickness surface: two points.
CadaclysmFlatPattern
class CadaclysmFlatPattern extends RefCounted
A sheet body laid flat — what CadaclysmSolid.flat_pattern() returns. It holds a handle of the library's, freed as Lifetimes describes.
CadaclysmFlatPattern.body
var body: Variant # read-only
The flat body: the outline extruded the thickness down from the frame.
CadaclysmFlatPattern.profile
var profile: Variant # read-only
The flat's outline, a CadaclysmProfile in the frame's plane.
CadaclysmFlatPattern.frame
var frame: CadaclysmFrame # read-only
The frame the flat lies in: the fixed face's, its top the frame's plane.
CadaclysmFlatPattern.bends
var bends: Array[CadaclysmFlatBend] # read-only
Every bend zone as drawn, a CadaclysmFlatBend each.
CadaclysmFlatPattern.fold_bends
var fold_bends: Array[CadaclysmBend] # read-only
The part's bends as CadaclysmSolid.fold_flat() takes them back, a CadaclysmBend each.
CadaclysmFlatPattern.dxf()
func dxf(units: String = "mm", extents: bool = true, table: bool = true, labels: bool = true, notes: bool = false, dimensions: bool = false, folded: bool = false) -> String
The flat pattern alone as DXF R2000 text for a cutter: the outline on layer OUTLINE, each bend line on BEND_UP (green) or BEND_DOWN (red), centre-lined; extents adds the zones' edges on BEND_EXTENT, table a ruled table of the bends on BEND_TABLE, labels a label on each line (B1 UP 90), and, as CadaclysmPage.add_flat_pattern() draws them, notes, dimensions and folded.
CadaclysmFlatPattern.close()
func close() -> void
Free the handle now. Leaving a with block or the garbage collector does the same.
CadaclysmFlatBend
class CadaclysmFlatBend extends RefCounted
One bend zone of a CadaclysmFlatPattern, in the flat's own plane.
CadaclysmFlatBend.centre
var centre: PackedFloat64Array # read-only
The zone's centre line: two points.
CadaclysmFlatBend.start
var start: PackedFloat64Array # read-only
The zone's first edge: two points.
CadaclysmFlatBend.deduction
var deduction: float # read-only
The bend deduction: twice the outside setback less the allowance.
CadaclysmBend
class CadaclysmBend extends RefCounted
A bend to fold — what CadaclysmSolid.fold_flat() takes, and CadaclysmFlatPattern.fold_bends gives.
CadaclysmBend.line
var line: PackedFloat64Array # read-only
The bend's line across the flat: two points.
create Godot only
static func create(line: Variant, angle: float, radius: float, k_factor: float = 0.44) -> CadaclysmBend
Python's Bend(line, angle, radius, k_factor), k_factor defaulted to 0.44. (new is GDScript's own, so the constructor is create.)
CadaclysmUnrolled
class CadaclysmUnrolled extends RefCounted
Faces of a solid laid flat — what CadaclysmSolid.unroll() returns, read at once.
CadaclysmUnrolled.sheet
var sheet: CadaclysmSolid # read-only
The flat faces as one open CadaclysmSolid in the xy plane.
CadaclysmUnrolled.curves
var curves: Array # read-only
Each curve given, as its pieces on the flat (CadaclysmNurbsCurve values).
CadaclysmUnrolled.points
var points: Array # read-only
Each point given at its spot on the flat; none where it lies on no face laid flat.
CadaclysmUnrolled.not_developable
var not_developable: PackedInt64Array # read-only
The faces left out because they are not developable.
CadaclysmUnrolled.cuts
var cuts: Array[PackedInt64Array] # read-only
The shared edges cut, as pairs of source faces.
FromMeshReport
What CadaclysmSolid.from_mesh() made of a mesh, as plain data.
CadaclysmSolid.from_mesh returns the report as a Dictionary of these keys.
FromMeshReport.closed
Whether the result is a closed solid: every edge shared by two triangles, every shell orientable. Otherwise it is an open shell.
CadaclysmSolid.from_mesh returns the report as a Dictionary of these keys.
FromMeshReport.faces
The result's faces.
CadaclysmSolid.from_mesh returns the report as a Dictionary of these keys.
FromMeshReport.edges
The result's edges.
CadaclysmSolid.from_mesh returns the report as a Dictionary of these keys.
FromMeshReport.vertices
The result's vertices, after welding.
CadaclysmSolid.from_mesh returns the report as a Dictionary of these keys.
FromMeshReport.holes
Holes in the mesh: connected runs of boundary edges.
CadaclysmSolid.from_mesh returns the report as a Dictionary of these keys.
FromMeshReport.boundary_edges
Triangle edges only one triangle has.
CadaclysmSolid.from_mesh returns the report as a Dictionary of these keys.
FromMeshReport.non_manifold_edges
Triangle edges three or more triangles share; never repaired.
CadaclysmSolid.from_mesh returns the report as a Dictionary of these keys.
FromMeshReport.flipped
Triangles whose winding the result reverses: to agree with their neighbours, or with a whole shell turned outward (or inward, for a void).
CadaclysmSolid.from_mesh returns the report as a Dictionary of these keys.
FromMeshReport.dropped
Triangles dropped as degenerate after welding (a repeated corner, no area).
CadaclysmSolid.from_mesh returns the report as a Dictionary of these keys.
CadaclysmSquished
class CadaclysmSquished extends RefCounted
Faces of a solid squished flat — what CadaclysmSolid.squish() returns, read at once.
CadaclysmSquished.sheet
var sheet: CadaclysmSolid # read-only
The flat faces as one open CadaclysmSolid in the xy plane.
CadaclysmSquished.distortion
var distortion: Array[Dictionary] # read-only
Each flat face's distortion, flat over 3D: its area ratio per mesh triangle and its length ratio per mesh edge, each as min, max and mean (weighted by the 3D area or length). A face laid exactly has lengths 1.
CadaclysmSquished.exact
var exact: PackedInt64Array # read-only
The source faces laid exactly, as CadaclysmSolid.unroll() lays them.
CadaclysmSquished.curves
var curves: Array # read-only
Each curve given, as its pieces on the flat (CadaclysmNurbsCurve values).
CadaclysmSquished.points
var points: Array # read-only
Each point given at its spot on the flat; none where it lies on no face squished.
CadaclysmFacePoint
class CadaclysmFacePoint extends RefCounted
Where a point lies against a face — what CadaclysmSolid.face_point() and CadaclysmSolid.face_inner_point() return.
CadaclysmFacePoint.point
var point: PackedFloat64Array # read-only
The nearest point of the face, inside its trims or on their boundary.
CadaclysmFacePoint.uv
var uv: PackedFloat64Array # read-only
That point's parameters on the face's surface.
CadaclysmEdgePoint
class CadaclysmEdgePoint extends RefCounted
The nearest point of an edge's curve — what CadaclysmSolid.edge_point() and CadaclysmSolid.edge_inner_point() return.
CadaclysmEdgePoint.point
var point: PackedFloat64Array # read-only
The nearest point of the edge's curve over its range.
CadaclysmEdgeConvexity
class CadaclysmEdgeConvexity extends RefCounted
How an edge's two faces meet — what CadaclysmSolid.edge_convexity() returns.
CadaclysmEdgeConvexity.angle_min
var angle_min: float # read-only
The smallest signed turn between the faces' outward normals, in radians (negative concave).
CadaclysmEdgeConvexity.samples
var samples: int # read-only
The points asked along the edge (0 for an open edge or a closed surface's seam).
CadaclysmAngle
class CadaclysmAngle extends RefCounted
The angle between two faces or edges — what CadaclysmSolid.angle_to() returns.
CadaclysmAngle.at_a
var at_a: PackedFloat64Array # read-only
Where it is read on the first entity: its inner point, or for an axis the axis point nearest it.
CadaclysmAngle.kind
var kind: String # read-only
What the two were read as: two planes, two lines, or a line and a plane.
CadaclysmMinimumRadius
class CadaclysmMinimumRadius extends RefCounted
A face's smallest radius of curvature — what CadaclysmSolid.face_minimum_radius() returns.
CadaclysmMinimumRadius.radius
var radius: float # read-only
1 / max(|k1|, |k2|); infinite for a plane.
CadaclysmMinimumRadius.curvature
var curvature: float # read-only
That principal curvature, signed about the face's outward normal: positive where the face bends away from it (a boss), negative toward it (a bore).
CadaclysmMinimumRadius.uv
var uv: PackedFloat64Array # read-only
Its parameters on the face's surface.
CadaclysmMinimumRadius.direction
var direction: PackedFloat64Array # read-only
The curvature's unit principal direction.
CadaclysmMinimumRadius.samples
var samples: int # read-only
The grid stations read inside the trims (0 where a closed form answered).
CadaclysmGearProfile
class CadaclysmGearProfile extends RefCounted
A gear's profile and its report — what CadaclysmProfile.gear_involute(), CadaclysmProfile.gear_wheel_cycloidal() and CadaclysmProfile.gear_pinion_cycloidal() return. Frozen.
CadaclysmGearProfile.profile
var profile: CadaclysmProfile # read-only
The gear's closed outline, a CadaclysmProfile.
CadaclysmGearProfile.pitch_radius
var pitch_radius: float # read-only
The pitch radius, module teeth / 2.
CadaclysmGearProfile.base_radius
var base_radius: Variant # read-only
The involute's base circle, pitch_radius cos(pressure_angle); null for cycloidal gearing.
CadaclysmGearProfile.tip_radius
var tip_radius: float # read-only
The largest radius on the profile.
CadaclysmGearProfile.root_radius
var root_radius: float # read-only
The smallest radius on the profile.
CadaclysmGearProfile.thickness
var thickness: float # read-only
The tooth (leaf) thickness on the pitch circle, as an arc length.
CadaclysmGearProfile.undercut
var undercut: bool # read-only
Involute only: whether the gear's cutter would undercut it. The undercut is not drawn: the flank starts on the base or root circle.
CadaclysmAreaProperties
class CadaclysmAreaProperties extends RefCounted
A profile's area properties in its own plane — what CadaclysmProfile.area_properties() returns.
CadaclysmAreaProperties.area
var area: float # read-only
The region's area: the outer loop less its holes.
CadaclysmAreaProperties.perimeter
var perimeter: float # read-only
Every loop's length, holes included.
CadaclysmAreaProperties.centroid
var centroid: PackedFloat64Array # read-only
In the profile's coordinates.
CadaclysmAreaProperties.second_moments
var second_moments: PackedFloat64Array # read-only
(Ixx, Iyy, Ixy) about the centroid: Ixx about the axis parallel to x, Ixy the product itself, not negated (unlike a solid's inertia).
CadaclysmAreaProperties.principal_moments
var principal_moments: PackedFloat64Array # read-only
Ascending.
CadaclysmAreaProperties.principal_axes
var principal_axes: Array[PackedFloat64Array] # read-only
Their two unit axes, the second the first turned a right angle.
CadaclysmAreaProperties.accuracy_met
var accuracy_met: bool # read-only
Whether every bound is within the accuracy asked.
CadaclysmDeviation
class CadaclysmDeviation extends RefCounted
How far apart two profiles' outlines run, as a named tuple: what CadaclysmProfile.deviation() returns. max_distance is the largest distance from a point of either outline to the other, reached between max_a on the profile asked and max_b on the other; min_distance the smallest (0 where they meet), between min_a and min_b. Points are (x, y); every figure within the tolerance asked of the true one.
the fields Godot only
var max_distance: float # read-only
var max_a: PackedFloat64Array # read-only
var max_b: PackedFloat64Array # read-only
var min_distance: float # read-only
var min_a: PackedFloat64Array # read-only
var min_b: PackedFloat64Array # read-only
The named tuple's fields as read-only properties, each point a PackedFloat64Array of (x, y).
Polygon
A regular polygon added to a sketch, as CadaclysmSketch.add_polygon() returns it: plain data. centre is the centre point's id, circumcircle and incircle the two construction circles', corners the corner points' ids and sides the side lines' ids (side k runs corner k to corner k + 1).
No class: a Dictionary with these keys, empty on a refusal.
Chamfer
What CadaclysmSketch.chamfer() and CadaclysmSketch.chamfer_angle() added, as plain data: line the new line's id, points the ids of its two ends (on a, then on b), corner the old corner point, kept as the virtual sharp, and dimensions the two driving dimensions (along a, then along b or the angle).
No class: a Dictionary with these keys, empty on a refusal.
SketchPattern
What CadaclysmSketch.pattern_rectangular() and CadaclysmSketch.pattern_circular() added, as plain data: copies one list of entity ids per copy (the source excluded, each in the order of the source entities; rectangular copies row by row, the first direction fastest), steps the construction lines of a circular pattern (two, none for a rectangular one) and dimensions the driving dimensions (rectangular: the first step's horizontal and vertical distances, then the second's where it is used; circular: the step angle).
No class: a Dictionary with these keys, empty on a refusal.
CadaclysmPatchReport
class CadaclysmPatchReport extends RefCounted
How well an N-sided patch meets — CadaclysmSolid.patch_report, measured with CadaclysmSolid.continuity() on every neighbour and every spoke.
CadaclysmPatchReport.boundary
var boundary: CadaclysmContinuity # read-only
The worst CadaclysmContinuity against the neighbours: the gap over every side, the angle over those met at G1 or G2, the curvature over those met at G2.
CadaclysmPatchReport.internal
var internal: CadaclysmContinuity # read-only
The worst CadaclysmContinuity across the patch's own spokes.
CadaclysmPatchReport.corner_angle
var corner_angle: float # read-only
The largest angle, in radians, between a boundary's tangent at a corner of the hole and the neighbour before it's tangent plane: what no patch can meet there, 0 where the neighbours meet each other at G1.
CadaclysmCurvature
class CadaclysmCurvature extends RefCounted
A curve's bending at a parameter — what CadaclysmNurbsCurve.curvature() returns.
CadaclysmCurvature.kappa
var kappa: float # read-only
The curvature, 1 / radius; 0 on a straight piece.
CadaclysmCurvature.tangent
var tangent: PackedFloat64Array # read-only
The unit tangent, along increasing parameter.
CadaclysmCurvature.normal
var normal: PackedFloat64Array # read-only
The unit normal toward the centre of curvature; zero on a straight piece.
CadaclysmCurvature.binormal
var binormal: PackedFloat64Array # read-only
tangent x normal; zero on a straight piece.
CadaclysmCurvature.centre
var centre: Variant # read-only
The centre of the osculating circle, or null on a straight piece.
CadaclysmAt
class CadaclysmAt extends RefCounted
A point at arc length — what CadaclysmSolid.edge_point_at_length() and CadaclysmProfile.point_at_length() return, and each sample of the divides — beside an estimate of how far its arc length can be trusted.
CadaclysmAt.point
var point: Vector3 # read-only
The point.
A Vector3, so floats: compare to 1e-5, not 1e-9. raw_point gives the three doubles.
CadaclysmAt.tangent
var tangent: Vector3 # read-only
The unit tangent there, along the edge or loop; zero where the curve stops.
CadaclysmAt.parameter
var parameter: float # read-only
The curve's own parameter at the point: on an edge, its curve's (a circle's angle, a line's fraction); on a profile, its side's (a line's 0 to 1, an arc's angle about its centre — a clockwise arc's decreasing along it — a spline's parameter).
CadaclysmAt.segment
var segment: int # read-only
On a profile, the side the point lies on: its segment's index, or the segment count for the implicit closing side. Empty on an edge (None in Python, CADACLYSM_BLACKSMITH_NONE in C).
-1 for none.
CadaclysmAt.error
var error: float # read-only
An estimate of how far the true arc length to the point is from the s asked for: the length's error up to it plus the inversion's own residual.
CadaclysmAt.from_polyline
var from_polyline: bool # read-only
The curve was a sampled polyline: exact for its points and not for whatever they were sampled from.
raw_point Godot only
func raw_point() -> PackedFloat64Array
point's three doubles as a PackedFloat64Array: point is a Vector3 of floats, too coarse to check a point far from the origin to 1e-9.
CadaclysmClassifier
class CadaclysmClassifier extends RefCounted
A closed solid meshed once and asked where point after point lies: what CadaclysmSolid.classifier() returns. It keeps its own reference to the body. Calls on one classifier take turns (a lock inside the library), so build one per thread to classify in parallel.
CadaclysmClassifier.contains()
func contains(point: Variant) -> String
Where point is: inside, outside, or on within the tolerance of the boundary. A point not finite returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmClassifier.close()
func close() -> void
Free the handle. Leaving a with block or the garbage collector does the same.
CadaclysmProjector
class CadaclysmProjector extends RefCounted
A solid meshed once and asked for its nearest point to point after point: what CadaclysmSolid.projector() returns. It keeps the mesh, its search tree and each face's trim judge between queries, and its own reference to the body. Calls on one projector take turns (a lock inside the library), so build one per thread to ask in parallel.
CadaclysmProjector.closest_point()
func closest_point(p: Variant, max_distance: float = f64.NAN) -> CadaclysmPointFoot
The nearest point of the body's boundary to p, as a CadaclysmPointFoot, or null beyond max_distance — CadaclysmSolid.closest_point()'s answer, at the projector's tolerance. A point not finite or a negative max_distance returns null, false or an empty value (the reason in Cadaclysm.last_error()).
max_distance defaults to NaN, no limit. null beyond it leaves Cadaclysm.last_error() empty; a refusal is null with the reason there.
CadaclysmProjector.curve_closest_points()
func curve_closest_points(curve: CadaclysmNurbsCurve, max_distance: float = f64.NAN) -> CadaclysmCurveBodyFoot
The nearest points of curve and the body's boundary, as a CadaclysmCurveBodyFoot, or null beyond max_distance — CadaclysmSolid.curve_closest_points()'s answer, at the projector's tolerance. The projector's lock is held for the whole curve query: other threads asking this projector, for points or curves, wait for it. A negative max_distance or a curve too long for the tolerance returns null, false or an empty value (the reason in Cadaclysm.last_error()).
max_distance defaults to NaN, no limit; where the call takes a tolerance it defaults to NaN too, the model's policy. null beyond it leaves Cadaclysm.last_error() empty; a refusal is null with the reason there.
CadaclysmProjector.close()
func close() -> void
Free the handle. Leaving a with block or the garbage collector does the same.
CadaclysmPointFoot
class CadaclysmPointFoot extends RefCounted
The nearest point of a solid, or of one face, to a query point, as a named tuple: what CadaclysmSolid.closest_point(), CadaclysmProjector.closest_point() and CadaclysmSolid.face_closest_point() return. point lies on the boundary and distance is from the query point to it. What the point lies on is named as CadaclysmClosest names each side: kind is "face", "edge" or "vertex", index the kernel's id for it, and edge the index CadaclysmSolid.edges uses for an edge foot — what CadaclysmSolid.edge_length(), CadaclysmSolid.fillet() and CadaclysmSolid.edge_closest_point() take, so read edge, not index, for the public edge number — none for a face, a vertex, and an edge the fillet table does not hold. uv is the face parameter of a foot inside a face, none for an edge or a vertex foot. normal is unit: a face foot's outward normal; an edge or vertex foot's direction from the foot to the query point; on the body (distance 0) the mean of the adjacent faces' outward normals. refined is true when the foot was refined onto the exact geometry: distance is then never below the true minimum and within the tolerance of it; false is the mesh's answer, within [d - 2/3 tolerance, d + tolerance] of the true minimum d.
the fields, raw_point, raw_normal and equals Godot only
var point: Vector3 # read-only
var distance: float # read-only
var kind: String # read-only
var index: int # read-only
var edge: int # read-only
var uv: PackedFloat64Array # read-only
var normal: Vector3 # read-only
var refined: bool # read-only
var raw_point: PackedFloat64Array # read-only
var raw_normal: PackedFloat64Array # read-only
func equals(other: Variant) -> bool
The named tuple's fields as read-only properties: point and normal Vector3s of floats, raw_point and raw_normal the same three doubles each as a PackedFloat64Array; edge is -1 for none and uv two doubles, empty off a face. equals is Python's ==: whether another foot holds the same fields, every double equal.
CadaclysmCurvePair
class CadaclysmCurvePair extends RefCounted
The nearest points of two curves, as a named tuple: what CadaclysmNurbsCurve.closest_points() returns, and a CadaclysmNearestObject's answer for a curve. point_a lies on the curve asked at its parameter t_a, point_b on the other at t_b, distance apart (0 where they cross). Exact.
the fields, raw_point_a, raw_point_b and equals Godot only
var distance: float # read-only
var t_a: float # read-only
var point_a: Vector3 # read-only
var t_b: float # read-only
var point_b: Vector3 # read-only
var raw_point_a: PackedFloat64Array # read-only
var raw_point_b: PackedFloat64Array # read-only
func equals(other: Variant) -> bool
The named tuple's fields as read-only properties: point_a and point_b Vector3s of floats, raw_point_a and raw_point_b the same three doubles each as a PackedFloat64Array. equals is Python's ==: whether another pair holds the same fields, every double equal.
CadaclysmCurveBodyFoot
class CadaclysmCurveBodyFoot extends RefCounted
The nearest points of a curve and a solid's boundary, as a named tuple: what CadaclysmSolid.curve_closest_points() and CadaclysmProjector.curve_closest_points() return, and a CadaclysmNearestObject's answer for a solid or a projector. point_on_curve lies on the curve at its parameter t, point_on_body on the boundary, distance apart. crossing is true where the curve passes through the boundary: distance is then exactly 0 and the earliest crossing in t answers. The body's side is the point query's foot at point_on_curve, named as CadaclysmPointFoot names it: kind, index the kernel's id, and edge the index CadaclysmSolid.edges uses for an edge foot (read edge, not index, for the public edge number; none otherwise), uv none off a face, normal unit. refined false is the mesh's answer, within [d - 2/3 tolerance, d + tolerance] of the true minimum d.
the fields, the raw_ points and normal, and equals Godot only
var distance: float # read-only
var t: float # read-only
var point_on_curve: Vector3 # read-only
var point_on_body: Vector3 # read-only
var kind: String # read-only
var index: int # read-only
var edge: int # read-only
var uv: PackedFloat64Array # read-only
var normal: Vector3 # read-only
var refined: bool # read-only
var crossing: bool # read-only
var raw_point_on_curve: PackedFloat64Array # read-only
var raw_point_on_body: PackedFloat64Array # read-only
var raw_normal: PackedFloat64Array # read-only
func equals(other: Variant) -> bool
The named tuple's fields as read-only properties: point_on_curve, point_on_body and normal Vector3s of floats, raw_point_on_curve, raw_point_on_body and raw_normal the same three doubles each as a PackedFloat64Array; edge is -1 for none and uv two doubles, empty off a face. equals is Python's ==: whether another foot holds the same fields, every double equal.
CadaclysmNearestObject
class CadaclysmNearestObject extends RefCounted
The nearest of a list of things to a curve, as a named tuple: what CadaclysmNurbsCurve.closest_object() returns. which is the item's index in the list, distance from point_on_curve (at the curve's parameter t) to point_on_item. answer is the item's own answer: a CadaclysmCurveBodyFoot for a solid or a projector, a CadaclysmCurvePair (side a the curve asked) for a curve, a CadaclysmCurveMeshFoot for a CadaclysmTriangleMesh, a CadaclysmCurveSurfaceFoot for a CadaclysmNurbsSurface, none for a point.
the fields, the raw_ points and equals Godot only
var which: int # read-only
var distance: float # read-only
var t: float # read-only
var point_on_curve: Vector3 # read-only
var point_on_item: Vector3 # read-only
var answer: Variant # read-only
var raw_point_on_curve: PackedFloat64Array # read-only
var raw_point_on_item: PackedFloat64Array # read-only
func equals(other: Variant) -> bool
The named tuple's fields as read-only properties: which from zero, point_on_curve and point_on_item Vector3s of floats, raw_point_on_curve and raw_point_on_item the same three doubles each as a PackedFloat64Array; answer a CadaclysmCurveBodyFoot, a CadaclysmCurvePair, a CadaclysmCurveMeshFoot, a CadaclysmCurveSurfaceFoot or null for a point. equals is Python's ==: whether another answer holds the same fields, every double equal.
CadaclysmTriangleMesh
class CadaclysmTriangleMesh extends RefCounted
A triangle mesh and its search tree, built once and immutable: nearest points and nearest points to a curve are answered exactly against it — no tolerance, no refined figure. TriangleMesh(positions, indices) takes the vertices and the triangles (three vertex indices each, any winding), each as a sequence of triples, one flat sequence, or an array; both are copied. A zero-area triangle is accepted and answers as its longest edge. CadaclysmSolid.triangle_mesh() gives a solid's own. No triangles, an index past the vertex count, or a coordinate that is not finite returns null, false or an empty value (the reason in Cadaclysm.last_error()). Nothing in it changes after it is built, so calls on one mesh from several threads at once are safe and do not take turns. Close it when done, or let the language's scope do it; see Lifetimes.
CadaclysmTriangleMesh.triangle_count()
func triangle_count() -> int
How many triangles the mesh holds.
CadaclysmTriangleMesh.closest_point()
func closest_point(p: Variant, max_distance: float = f64.NAN) -> CadaclysmMeshPoint
The nearest point of the mesh to p, as a CadaclysmMeshPoint — exact, the lower triangle where several share the point — or null where it lies beyond max_distance (none, NaN or infinite: no limit; a point on the mesh is within 0). A point not finite or a negative max_distance returns null, false or an empty value (the reason in Cadaclysm.last_error()).
max_distance defaults to NaN, no limit; where the call takes a tolerance it defaults to NaN too, the model's policy. null beyond it leaves Cadaclysm.last_error() empty; a refusal is null with the reason there.
CadaclysmTriangleMesh.curve_closest_points()
func curve_closest_points(curve: CadaclysmNurbsCurve, max_distance: float = f64.NAN) -> CadaclysmCurveMeshFoot
The nearest points of curve and the mesh, as a CadaclysmCurveMeshFoot, or null where the mesh lies farther than max_distance (none, NaN or infinite: no limit). Exact. Where the curve passes through a triangle the answer is a crossing, distance exactly 0, at the earliest crossing in t; among equal distances the lower triangle, then the lower t, answers. A mesh has no inside: a curve within a closed mesh answers its distance to the triangles. A curve that is not valid or a negative max_distance returns null, false or an empty value (the reason in Cadaclysm.last_error()).
max_distance defaults to NaN, no limit; where the call takes a tolerance it defaults to NaN too, the model's policy. null beyond it leaves Cadaclysm.last_error() empty; a refusal is null with the reason there.
CadaclysmTriangleMesh.close()
func close() -> void
Free this handle now. Leaving a with block or the garbage collector does the same.
create Godot only
static func create(positions: Variant, triangles: Variant) -> CadaclysmTriangleMesh
Python's TriangleMesh(positions, indices): the points a PackedVector3Array or an array of points (the array keeps a double's precision), the triangles a flat PackedInt32Array / PackedInt64Array, three indices a triangle, or an array of triples. null for a shape that is not one or an index outside 0 to 4294967295, and for the kernel's own refusals. (new is GDScript's own, so the constructor is create.)
raw_bounds Godot only
func raw_bounds() -> PackedFloat64Array
CadaclysmTriangleMesh.bounds() as six doubles, min x, y, z then max x, y, z, where bounds() is an AABB of floats; empty on a closed mesh.
CadaclysmMeshPoint
class CadaclysmMeshPoint extends RefCounted
The nearest point of a CadaclysmTriangleMesh to a query point: what CadaclysmTriangleMesh.closest_point() returns. Exact.
CadaclysmMeshPoint.distance
var distance: float # read-only
The distance from the query point to point.
CadaclysmMeshPoint.triangle
var triangle: int # read-only
The lowest-numbered triangle holding the point: on an edge or a vertex several triangles share, the lower triangle answers.
CadaclysmMeshPoint.barycentric
var barycentric: PackedFloat64Array # read-only
The point's three weights on triangle's corners, in index order, summing to 1.
CadaclysmMeshPoint.kind
var kind: String # read-only
What the point lies on: "face" (inside triangle), "edge" or "vertex".
CadaclysmMeshPoint.vertices
var vertices: PackedInt64Array # read-only
What kind names: an edge's two vertex indices ascending, a vertex's one, none for a face.
raw_point and equals Godot only
var raw_point: PackedFloat64Array # read-only
func equals(other: Variant) -> bool
point as three doubles, where the property holds a Vector3 of floats; barycentric is a PackedFloat64Array and vertices a PackedInt64Array of 0, 1 or 2 indices. equals is Python's ==: whether another foot holds the same fields, every double equal.
CadaclysmCurveMeshFoot
class CadaclysmCurveMeshFoot extends RefCounted
The nearest points of a curve and a CadaclysmTriangleMesh: what CadaclysmTriangleMesh.curve_closest_points() returns, and a CadaclysmNearestObject's answer for a mesh. Exact. The mesh's side is named as CadaclysmMeshPoint names it, flat.
CadaclysmCurveMeshFoot.distance
var distance: float # read-only
The distance from point_on_curve to point_on_mesh.
CadaclysmCurveMeshFoot.point_on_curve
var point_on_curve: Vector3 # read-only
The point on the curve.
CadaclysmCurveMeshFoot.triangle
var triangle: int # read-only
The lowest-numbered triangle holding point_on_mesh.
CadaclysmCurveMeshFoot.barycentric
var barycentric: PackedFloat64Array # read-only
point_on_mesh's three weights on triangle's corners, in index order, summing to 1.
CadaclysmCurveMeshFoot.kind
var kind: String # read-only
What point_on_mesh lies on: "face", "edge" or "vertex".
CadaclysmCurveMeshFoot.vertices
var vertices: PackedInt64Array # read-only
What kind names: an edge's two vertex indices ascending, a vertex's one, none for a face.
CadaclysmCurveMeshFoot.crossing
var crossing: bool # read-only
true where the curve passes through a triangle: distance is then exactly 0, at the earliest crossing in t. A curve that touches without passing through is distance 0 and false.
raw_point_on_curve, raw_point_on_mesh and equals Godot only
var raw_point_on_curve: PackedFloat64Array # read-only
var raw_point_on_mesh: PackedFloat64Array # read-only
func equals(other: Variant) -> bool
point_on_curve and point_on_mesh as three doubles each, where the properties hold Vector3s of floats; barycentric is a PackedFloat64Array and vertices a PackedInt64Array of 0, 1 or 2 indices. equals is Python's ==: whether another foot holds the same fields, every double equal.
CadaclysmNurbsSurface
class CadaclysmNurbsSurface extends RefCounted
An untrimmed NURBS surface, immutable: nearest points and nearest points to a curve are answered exactly against it — no tolerance, no refined figure. NurbsSurface(points, counts, degree_u, degree_v, weights, knots_u, knots_v) takes the control net of counts = (n_u, n_v) points, rows along u (point i * n_v + j is row i, column j), as a sequence of triples, one flat sequence, or an array; degrees 1 to 7 (3 by default); weights one per point, positive and finite, or none for a plain B-spline; and the full clamped knot vectors (n + degree + 1 values each, non-decreasing, the first and the last degree + 1 equal), or none for clamped and uniform over [0, 1]. Everything is copied. CadaclysmSolid.face_surface() gives a face's own. A degree out of range, too few points for a degree, a point that is not finite, a bad weight, or knots of the wrong count, decreasing or not clamped returns null, false or an empty value (the reason in Cadaclysm.last_error()). Its Bézier patches are cut once, at the first query, and kept; nothing else in it changes, so calls on one surface from several threads at once are safe. Close it when done, or let the language's scope do it; see Lifetimes.
CadaclysmNurbsSurface.counts()
func counts() -> Vector2i
The control net's size, (n_u, n_v).
A Vector2i(n_u, n_v).
CadaclysmNurbsSurface.domain()
func domain() -> PackedFloat64Array
The parameter domain, ((u0, u1), (v0, v1)).
Four doubles, u0, u1, v0, v1, as a PackedFloat64Array.
CadaclysmNurbsSurface.point_at()
func point_at(u: float, v: float) -> Vector3
The point at (u, v). A parameter outside the domain or not finite returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsSurface.normal_at()
func normal_at(u: float, v: float) -> Vector3
The unit normal at (u, v) (dS/du x dS/dv, normalised). A parameter outside the domain or not finite, or a place where the partials are parallel (a pole — exactly where a CadaclysmSurfacePoint's normal is zero), returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsSurface.to_sheet()
func to_sheet() -> CadaclysmSolid
The whole surface as an open one-face sheet CadaclysmSolid. The sheet's face is this surface reparametrised over [0, 1] x [0, 1]: its CadaclysmSolid.face_surface() has that domain, not this one's. A surface of no size returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsSurface.closest_point()
func closest_point(p: Variant, max_distance: float = f64.NAN) -> CadaclysmSurfacePoint
The nearest point of the surface to p, as a CadaclysmSurfacePoint — exact, the lower u, then the lower v, among equal distances — or null where it lies beyond max_distance (none, NaN or infinite: no limit; a point on the surface is within 0). A point not finite or a negative max_distance returns null, false or an empty value (the reason in Cadaclysm.last_error()).
max_distance defaults to NaN, no limit; where the call takes a tolerance it defaults to NaN too, the model's policy. null beyond it leaves Cadaclysm.last_error() empty; a refusal is null with the reason there.
CadaclysmNurbsSurface.curve_closest_points()
func curve_closest_points(curve: CadaclysmNurbsCurve, max_distance: float = f64.NAN) -> CadaclysmCurveSurfaceFoot
The nearest points of curve and the surface, as a CadaclysmCurveSurfaceFoot, or null where the surface lies farther than max_distance (none, NaN or infinite: no limit). Exact. Where the curve passes through the surface the answer is a crossing, distance exactly 0, at the earliest crossing in t; among equal distances the lower u, then v, then t, answers. A curve that is not valid or a negative max_distance returns null, false or an empty value (the reason in Cadaclysm.last_error()).
max_distance defaults to NaN, no limit; where the call takes a tolerance it defaults to NaN too, the model's policy. null beyond it leaves Cadaclysm.last_error() empty; a refusal is null with the reason there.
CadaclysmNurbsSurface.control_points()
func control_points() -> PackedFloat64Array
The control net, n_u * n_v points, row i (along u) point j at i * n_v + j — the order the constructor takes them in.
CadaclysmNurbsSurface.weights()
func weights() -> PackedFloat64Array
The weights, one per control point in the net's order (all 1 for a plain B-spline).
CadaclysmNurbsSurface.knots()
func knots(direction: String) -> PackedFloat64Array
The full knot vector along direction ("u" or "v"): n + degree + 1 values. Another direction returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsSurface.elevate()
func elevate(direction: String, by: int = 1) -> CadaclysmNurbsSurface
The same surface, exactly, raised by degrees (1 by default) along direction (to at most 12; Rhino's IncreaseDegreeU/V).
CadaclysmNurbsSurface.insert_knot()
func insert_knot(direction: String, t: float, times: int = 1) -> CadaclysmNurbsSurface
The same surface, exactly, with the knot t (strictly inside the domain) inserted times times along direction: more control points, every point kept. A t outside the domain, a times of 0, or a multiplicity past the degree, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsSurface.refine_knots()
func refine_knots(direction: String, knots: PackedFloat64Array) -> CadaclysmNurbsSurface
The same surface, exactly, with every knot of knots (non-decreasing, each strictly inside the domain, no multiplicity past the degree) inserted along direction.
CadaclysmNurbsSurface.remove_knot()
func remove_knot(direction: String, t: float, times: int = 1, tolerance: float = 0.0) -> Variant
Up to times copies of the inner knot t along direction removed, each only while every row of the net stays within tolerance (an absolute length; none, 0 or NaN: the net's effective tolerance) of itself: the surface and how many went — 0, and an unchanged copy, where none could. A t that is not an inner knot, or a negative tolerance, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Answers [curve or surface, removed], or null on a refusal.
CadaclysmNurbsSurface.extend()
func extend(side: String, length: float) -> CadaclysmNurbsSurface
The surface continued length past side ("u_start", "u_end", "v_start" or "v_end"; Rhino's Surface.Extend) along its own end polynomials — curvature-continuous, every old (u, v) keeping its point, the domain grown on that side. Another side, or a length that is not positive and finite, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsSurface.offset()
func offset(distance: float, tolerance: float = 0.0) -> CadaclysmNurbsSurface
This surface moved distance along its normal, as Rhino's Surface.Offset, over the same domain: its point at (u, v) within tolerance (none: the effective tolerance) of this one's point there moved distance along the normal. A plane offsets exactly (fit_error 0); any other surface is refitted, fit_error bounding the distance from the exact offset. The result holds the offset's values, not a reference back to this surface. A distance that is not finite, a surface with no normal somewhere, or an offset that folds over (a curvature radius used up) returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsSurface.fit_error
var fit_error: Variant # read-only
On a surface from CadaclysmNurbsSurface.offset(), the largest distance found between it and the exact offset; null on any other.
CadaclysmNurbsSurface.second_derivatives()
func second_derivatives(u: float, v: float) -> Array[PackedFloat64Array]
The point and its partial derivatives to second order at (u, v): (S, Su, Sv, Suu, Suv, Svv) (Rhino's Surface.Evaluate to order 2). A parameter outside the domain or not finite returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Answers six PackedFloat64Arrays of three doubles; empty on a refusal.
CadaclysmNurbsSurface.curvature()
func curvature(u: float, v: float) -> CadaclysmSurfaceCurvature
The principal, Gaussian and mean curvatures and the principal directions at (u, v), as a CadaclysmSurfaceCurvature (Rhino's Surface.CurvatureAt). A parameter outside the domain or not finite, or a pole (no normal), returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsSurface.hermite()
static func hermite(u: PackedFloat64Array, v: PackedFloat64Array, points: Variant, du: Variant, dv: Variant, twists: Variant) -> CadaclysmNurbsSurface
The bicubic Hermite surface through a grid (Rhino's HermiteSurface): u (at least 2) and v (at least 2) the grid's parameters, strictly rising; points, du, dv and twists a point for each node, node (i, j) at i * len(v) + j — its point, dS/du, dS/dv and d2S/dudv. Cubic both ways with a double knot at every inner grid parameter (C1 across), 2 len(u) x 2 len(v) control points, through every point with the given derivatives. A grid under 2 x 2, parameters not strictly rising, lists of the wrong length or numbers not finite returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmNurbsSurface.close()
func close() -> void
Free this handle now. Leaving a with block or the garbage collector does the same.
create Godot only
static func create(points: Variant, counts: Vector2i, degree_u: int = 3, degree_v: int = 3, weights: PackedFloat64Array = PackedFloat64Array(), knots_u: PackedFloat64Array = PackedFloat64Array(), knots_v: PackedFloat64Array = PackedFloat64Array()) -> CadaclysmNurbsSurface
Python's NurbsSurface(points, counts, degree_u, degree_v, weights, knots_u, knots_v): the net a PackedVector3Array or an array of points (the array keeps a double's precision), counts a Vector2i(n_u, n_v), weights, knots_u and knots_v PackedFloat64Arrays, empty for none. null for a net that is not its counts' points and for the kernel's own refusals. (new is GDScript's own, so the constructor is create.)
raw_point_at Godot only
func raw_point_at(u: float, v: float) -> PackedFloat64Array
CadaclysmNurbsSurface.point_at() as three doubles, where point_at answers a Vector3 of floats (a NaN one on a refusal); empty on a refusal.
CadaclysmSurfacePoint
class CadaclysmSurfacePoint extends RefCounted
The nearest point of a CadaclysmNurbsSurface to a query point: what CadaclysmNurbsSurface.closest_point() returns. Exact.
CadaclysmSurfacePoint.distance
var distance: float # read-only
The distance from the query point to point.
CadaclysmSurfacePoint.u
var u: float # read-only
The surface's u parameter at point: among equal distances the lower u, then the lower v, answers.
CadaclysmSurfacePoint.normal
var normal: Vector3 # read-only
The surface's unit normal at (u, v) (dS/du x dS/dv), or the zero vector where it has none: a pole, where the partials are parallel.
CadaclysmSurfacePoint.boundary
var boundary: bool # read-only
true where point lies on an edge of the patch (u or v at an end of the domain) and the way to the query point is not along the normal: the edge, not the surface's interior, is what is nearest.
raw_point and equals Godot only
var raw_point: PackedFloat64Array # read-only
func equals(other: Variant) -> bool
point as three doubles, where the property holds a Vector3 of floats; normal is a Vector3. equals is Python's ==: whether another foot holds the same fields, every double equal.
CadaclysmSurfaceCurvature
class CadaclysmSurfaceCurvature extends RefCounted
How a CadaclysmNurbsSurface bends at a point: what CadaclysmNurbsSurface.curvature() returns, from its first and second fundamental forms. Every curvature is signed about normal: positive where the surface bends toward it. A cylinder of radius r reads one curvature 0 and the other -1/r or 1/r, by which way the normal points.
CadaclysmSurfaceCurvature.dir1
var dir1: PackedFloat64Array # read-only
The unit tangent direction of k1; at an umbilic (k1 == k2) any orthonormal pair with dir2.
CadaclysmSurfaceCurvature.dir2
var dir2: PackedFloat64Array # read-only
The unit tangent direction of k2.
CadaclysmSurfaceCurvature.normal
var normal: PackedFloat64Array # read-only
The unit normal the signs are taken about, dS/du x dS/dv normalised.
equals Godot only
func equals(other: Variant) -> bool
dir1, dir2 and normal are three doubles each, a PackedFloat64Array. equals is Python's ==: whether another record holds the same fields, every double equal.
CadaclysmCurveSurfaceFoot
class CadaclysmCurveSurfaceFoot extends RefCounted
The nearest points of a curve and a CadaclysmNurbsSurface: what CadaclysmNurbsSurface.curve_closest_points() returns, and a CadaclysmNearestObject's answer for a surface. Exact. The surface's side is named as CadaclysmSurfacePoint names it, flat.
CadaclysmCurveSurfaceFoot.distance
var distance: float # read-only
The distance from point_on_curve to point_on_surface.
CadaclysmCurveSurfaceFoot.point_on_curve
var point_on_curve: Vector3 # read-only
The point on the curve.
CadaclysmCurveSurfaceFoot.point_on_surface
var point_on_surface: Vector3 # read-only
The point on the surface.
CadaclysmCurveSurfaceFoot.normal
var normal: Vector3 # read-only
The surface's unit normal at (u, v), or the zero vector at a pole.
CadaclysmCurveSurfaceFoot.boundary
var boundary: bool # read-only
true where point_on_surface lies on an edge of the patch and the way to the curve is not along the normal.
CadaclysmCurveSurfaceFoot.crossing
var crossing: bool # read-only
true where the curve passes through the surface: distance is then exactly 0, at the earliest meeting in t. A curve that touches without passing through is distance 0 and false.
raw_point_on_curve, raw_point_on_surface and equals Godot only
var raw_point_on_curve: PackedFloat64Array # read-only
var raw_point_on_surface: PackedFloat64Array # read-only
func equals(other: Variant) -> bool
point_on_curve and point_on_surface as three doubles each, where the properties hold Vector3s of floats; normal is a Vector3. equals is Python's ==: whether another foot holds the same fields, every double equal.
CadaclysmClosest
class CadaclysmClosest extends RefCounted
The closest points between two solids' boundaries: what CadaclysmSolid.closest() returns, side a the solid asked and side b the other. Each side names the feature its point lies on.
CadaclysmClosest.on_a
var on_a: Vector3 # read-only
The point on side a.
A Vector3, of floats; raw_on_a keeps the doubles.
CadaclysmClosest.on_b
var on_b: Vector3 # read-only
The point on side b.
A Vector3, of floats; raw_on_b keeps the doubles.
CadaclysmClosest.kind_a
var kind_a: String # read-only
What side a's point lies on: "face", "edge" or "vertex".
CadaclysmClosest.edge_a
var edge_a: int # read-only
Side a's edge as the index CadaclysmSolid.edges uses; none for a face or a vertex, and for an edge the fillet table does not hold (a trim with no exact curve).
-1 for none.
CadaclysmClosest.kind_b
var kind_b: String # read-only
What side b's point lies on: "face", "edge" or "vertex".
CadaclysmClosest.refined
var refined: bool # read-only
A refined answer is never below the true minimum and within the tolerance of it wherever the face pair holding the minimum refines to its own nearest pair. Where a nearer candidate did not converge, or left its trims and its boundary search found nothing, the mesh's answer comes back instead with refined false: within [d - 2/3 tolerance, d + tolerance] of the true minimum d.
raw_on_a and raw_on_b Godot only
var raw_on_a: PackedFloat64Array # read-only
var raw_on_b: PackedFloat64Array # read-only
CadaclysmClosest.on_a and CadaclysmClosest.on_b as three doubles each, where the properties hold Vector3s of floats.
Beziers
What CadaclysmSolid.silhouette_beziers returns: curves as cubic Béziers in double precision, four control points and four weights a curve. Unlike the reader's Beziers, the arrays are the wrapper's own — the kernel hands its buffer over and the wrapper releases it before the call returns — so there is nothing to outlive; they are read-only views over one copy kept alive by the arrays themselves.
Godot has no silhouette_beziers query, so it has no such type; the C API and the other wrappers have it.
Beziers.points
Four control points a curve, three doubles each: shape (count, 4, 3).
Godot has no silhouette_beziers query, so it has no such type; the C API and the other wrappers have it.
Beziers.weights
A weight per control point, as doubles: shape (count, 4). All ones for a polynomial curve, and the weights that make a circular arc exact for a rational one.
Godot has no silhouette_beziers query, so it has no such type; the C API and the other wrappers have it.
Beziers.count
How many curves. A Beziers is falsey when this is 0, the empty answer.
Godot has no silhouette_beziers query, so it has no such type; the C API and the other wrappers have it.
Beziers.copy
The same arrays, writable and contiguous, in memory of your own.
Godot has no silhouette_beziers query, so it has no such type; the C API and the other wrappers have it.
CadaclysmHlr
class CadaclysmHlr extends RefCounted
A hidden-line view of solids or meshes: what CadaclysmBlacksmith.hlr() and CadaclysmBlacksmith.hlr_mesh() return. Its lines, each seen or hidden, what the removal did, and the tolerance it worked at; placed on a drawing with CadaclysmPage.add_view(). Immutable. It holds a handle of the library's, freed as Lifetimes describes.
CadaclysmHlr.lines()
func lines() -> Array[CadaclysmHlrLine]
Every line, seen and hidden, as CadaclysmHlrLines.
CadaclysmHlr.report()
func report() -> Dictionary
What the removal did, as counts and lengths: candidates (curves considered), segments (the view-plane Béziers they projected to), crossings, pieces (pieces classified), degenerate (pieces shorter than the tolerance on the view plane, an edge seen end-on: not drawn), rays, mesh_hits, rejected, grazes, unsettled (pieces the evidence could not settle, decided by two more samples), mesh_only (hits taken on the mesh's word, a face with no readable trims), fallback_edges (edges with no exact curve, drawn from their polyline), failed_solids (solids that could not be placed or meshed, and so neither draw nor hide), candidate_length and degenerate_length (lengths in space). A dictionary in Python; the typed wrappers' report has the same fields in their own spelling.
CadaclysmHlr.tolerance
var tolerance: float # read-only
The tolerance the view was worked at, in model units: the one asked for, or the effective tolerance it resolved to.
close and closed Godot only
func close() -> void
var closed: bool # read-only
Godot's objects are not deterministically dropped, so a view takes an explicit close(); closed tells whether it has run. The view words of CadaclysmBlacksmith.hlr() and CadaclysmBlacksmith.hlr_mesh() are one Dictionary, every key optional: direction, up, eye and target each a Vector3 or three numbers, tolerance (0 or NaN: the effective tolerance), iso, smooth_angle and feature_angle; null with the reason in Cadaclysm.last_error() for a refusal.
CadaclysmHlrLine
class CadaclysmHlrLine extends RefCounted
One line of an CadaclysmHlr, as a named tuple: kind ("sharp", "smooth", "outline", "iso" or "boundary"), visible, solid the index of the solid (or mesh) it belongs to in the list given, and source, what it is a span of — ("edge", id), ("face", index) for a silhouette or an isocurve, or ("mesh_edge", a, b), a mesh edge's two vertices. Its curve is beziers2d, rational cubic Béziers on the view plane (z 0), and beziers3d, the same spans in space, Bézier for Bézier, each a Beziers; length2d is its length on the view plane and length3d in space, in model units.
the fields Godot only
var kind: String # read-only
var visible: bool # read-only
var solid: int # read-only
var source_kind: String # read-only
var source: int # read-only
var source2: int # read-only
var beziers2d: PackedFloat64Array # read-only
var beziers3d: PackedFloat64Array # read-only
var length2d: float # read-only
var length3d: float # read-only
The named tuple's fields as read-only properties. Python's source tuple is split: source_kind ("edge", "face" or "mesh_edge"), source (the edge id, the face index, or a mesh edge's first vertex) and source2 (a mesh edge's second vertex, -1 otherwise). beziers2d and beziers3d are flat PackedFloat64Arrays, sixteen doubles a Bézier: x, y, z, w for each of its four control points.
CadaclysmPage
class CadaclysmPage extends RefCounted
A flat drawing page: hidden-line views, profiles, hatches and text placed on it, written as SVG or as DXF R2000 (AC1015) that CAD programs open. Page(units) makes an empty one in millimetres (the default), centimetres, metres, inches, feet or no unit, written into the DXF's header. Layers are made on first use: a view's own — visible (seen sharp and boundary edges, 0.5 mm), outline (seen silhouettes, 0.5 mm), smooth (0.25 mm, grey), iso (0.18 mm, grey) and hidden (every hidden line, dashed, 0.25 mm) — and any other name continuous, colour 7. Mutable: each add_* changes the page. It holds a handle of the library's, freed as Lifetimes describes.
CadaclysmPage.add_view()
func add_view(view: CadaclysmHlr, at: Variant, scale: float = 1.0) -> bool
A view's lines (CadaclysmHlr) on the page, a view point p landing at at + scale * p: each line as the entities that draw it best — lines, arcs, circles, elliptical arcs, splines — on the view's layers.
CadaclysmPage.add_profile()
func add_profile(profile: CadaclysmProfile, at: Variant, layer: String = "") -> bool
A CadaclysmProfile's outline and holes on layer (null: 0), moved by at.
CadaclysmPage.add_hatch()
func add_hatch(profile: CadaclysmProfile, at: Variant, pattern: String = "ANSI31", angle: float = 0.0, scale: float = 1.0, layer: String = "") -> bool
A CadaclysmProfile hatched, its holes left out, on layer (null: hatch), moved by at: pattern SOLID, ANSI31, ANSI37 or ANSI32 (also STEEL), any case, turned angle radians, its spacing times scale. Another pattern name returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmPage.add_text()
func add_text(text: String, at: Variant, height: float, angle: float = 0.0, halign: String = "left", valign: String = "baseline", layer: String = "") -> bool
One line of text on layer (null: text) at at, height tall, turned angle radians; halign left (default), center or right, valign baseline (default), bottom, middle or top.
CadaclysmPage.add_flat_pattern()
func add_flat_pattern(flat: CadaclysmFlatPattern, at: Variant, extents: bool = true, table: bool = false, labels: bool = true, notes: bool = false, dimensions: bool = false, folded: bool = false) -> bool
A CadaclysmFlatPattern at at, 1:1: the outline on layer OUTLINE, each bend line on BEND_UP (green) or BEND_DOWN (red); extents adds the zones' edges on BEND_EXTENT, table a ruled table of the bends under the outline on BEND_TABLE (number, direction, angle, inner radius, K-factor, allowance, deduction), labels a label on each bend line, notes a bend note under each (UP 90° R1) on BEND_NOTE, dimensions the flat's overall width and height on DIMENSION (lines, arrowheads and text), and folded the folded part's front view right of the flat, at its scale, on FOLDED and FOLDED_HIDDEN.
CadaclysmPage.dxf()
func dxf() -> String
The page as DXF R2000 (AC1015) text: the same text for the same page. CadaclysmBlacksmith.dxf_profiles() reads its closed loops back.
create Godot only
static func create(units: String = "mm") -> CadaclysmPage
Python's Page(units), the unit by name, "mm" by default. (new is GDScript's own, as CadaclysmFrame.create is, so the constructor is create.) at on every add_* is a Vector2 or two numbers; the add_* calls answer true, or false with the reason in Cadaclysm.last_error(), and a layer of "" is the default layer.
entity_count Godot only
var entity_count: int # read-only
How many entities the page holds — Python's len(page).
close and closed Godot only
func close() -> void
var closed: bool # read-only
An explicit close(), as CadaclysmSolid.close() is; closed tells whether it has run.
CadaclysmBox
class CadaclysmBox extends RefCounted
An axis-aligned box: lo and hi, three numbers each. The broad phase's own shape (CadaclysmSolid.bounds_box(), CadaclysmCollider's own boxes): cheap to move and to test against another before anything is meshed.
CadaclysmBox.moved()
func moved(frame_arg: Variant) -> CadaclysmBox
This box moved by frame (rigid), boxed again on the world axes — not this box's corners individually moved, which would not in general be a box at all: the *bounding* box of the moved corners. A frame not twelve finite numbers or not rigid returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmBox.overlaps()
func overlaps(other: CadaclysmBox) -> bool
Whether this box and other share a point (touching counts).
create Godot only
static func create(lo: Vector3, hi: Vector3) -> CadaclysmBox
Python's Box(lo, hi): a box from its low and high corners. (new is GDScript's own, as CadaclysmFrame.create is, so the constructor is create.)
CadaclysmRegion
class CadaclysmRegion extends RefCounted
One region of space a solid's faces bound, as CadaclysmSolid.regions() returns it: a value, equal by value, that does not change. CadaclysmSolid.region_solid() takes a finite one as a solid of its own.
CadaclysmRegion.index
var index: int # read-only
Its index in CadaclysmSolid.regions(): 0 for the infinite region.
CadaclysmRegion.finite
var finite: bool # read-only
false for region 0, the one reaching to infinity; true for every other.
CadaclysmRegion.sides
var sides: Array[CadaclysmFaceSide] # read-only
Every face side bounding it, as CadaclysmFaceSide values, ascending by face and then sense (-1 first).
CadaclysmRegion.shells
var shells: int # read-only
How many connected boundaries it has: 1, plus one per void inside it.
CadaclysmFaceSide
class CadaclysmFaceSide extends RefCounted
One side of one face, as a CadaclysmRegion lists its sides: a value, equal by value.
CadaclysmFaceSide.sense
var sense: int # read-only
+1 for the side the face's normal points to, -1 for the other. A solid's inside is behind its faces, at -1.
CadaclysmColliderStats
class CadaclysmColliderStats extends RefCounted
Counts of one CadaclysmCollider.check() call, as CadaclysmCollider.stats() returns them (all zero before the first call): the candidate pairs considered, how many of them the world boxes and the oriented boxes cleared, how many the share left to another call, how the rest were answered (cached, closed_form, meshed), and how many were refused. confirmed is the subset of meshed that were thin mesh-path overlaps sent to CadaclysmSolid.common() itself for a final answer.
CadaclysmColliderStats.considered
var considered: int # read-only
The candidate pairs looked at: every pair of parts in different groups, less any in allowed or skipped_share.
CadaclysmColliderStats.world_boxes
var world_boxes: int # read-only
Of those, how many two world boxes (CadaclysmBox.overlaps()) cleared at once — decided apart with no oriented test.
CadaclysmColliderStats.oriented_boxes
var oriented_boxes: int # read-only
Of the rest, how many CadaclysmBox.boxes_apart() cleared — decided apart on the parts' own oriented boxes.
CadaclysmColliderStats.cached
var cached: int # read-only
Pairs answered from an earlier pose's cache rather than worked afresh.
CadaclysmColliderStats.closed_form
var closed_form: int # read-only
Pairs decided by an exact formula (both parts a shape the kernel has one for), no mesh built.
CadaclysmColliderStats.meshed
var meshed: int # read-only
Pairs that needed a mesh-against-mesh test to decide.
CadaclysmColliderStats.refused
var refused: int # read-only
Pairs that could not be decided at all — each a CadaclysmCollisionHit with kind "refused".
CadaclysmColliderStats.confirmed
var confirmed: int # read-only
Of meshed, how many thin mesh-path overlaps were sent on to CadaclysmSolid.common() itself for a final answer.
CadaclysmCollisionHit
class CadaclysmCollisionHit extends RefCounted
One pair CadaclysmCollider.check() found overlapping (kind "overlap"), or could not decide (kind "refused", text says why), as plain data. positions/normals are world xyz triples, three per triangle (unwelded); indices indexes them — all empty for a refused pair. depth is the thinnest side of the overlap's world box, 0 for a refused pair.
CadaclysmCollisionHit.solid() rebuilds the exact overlap now, from the frames CadaclysmCollider.check() found it at; this keeps the check call's own answer alive behind every hit of it until the last one is let go, freeing it only then.
CadaclysmCollisionHit.a
var a: int # read-only
The first part's index, as given to CadaclysmCollider.
CadaclysmCollisionHit.overlap
var overlap: bool # read-only
The same answer as kind, as a plain bool.
CadaclysmCollisionHit.depth
var depth: float # read-only
The thinnest side of the overlap's world box; 0 for a refused pair.
CadaclysmCollisionHit.text
var text: String # read-only
Why a refused pair could not be decided; empty for an overlap.
CadaclysmCollisionHit.positions
var positions: PackedVector3Array # read-only
The overlap solid's mesh positions, world xyz triples, three per triangle (unwelded); empty for a refused pair.
CadaclysmCollisionHit.normals
var normals: PackedVector3Array # read-only
The overlap solid's mesh normals, matching positions; empty for a refused pair.
CadaclysmCollisionHit.indices
var indices: PackedInt32Array # read-only
Indices into positions/normals; empty for a refused pair.
CadaclysmCollisionHit.solid()
func solid() -> CadaclysmSolid
The exact overlap of this pair at the frames CadaclysmCollider.check() found it at, as a new CadaclysmSolid. returns null, false or an empty value (the reason in Cadaclysm.last_error()) for a refused pair (kind "refused") or a check answer already closed some other way.
CadaclysmClash
class CadaclysmClash extends RefCounted
One pair CadaclysmBlacksmith.clash() or CadaclysmCollider.clash() found, as plain data. kind is "penetrating" (the volumes overlap), "touching" (the boundaries are within the tolerance of each other), "too_close" (apart by more than the tolerance but less than the clearance) or "refused" (the pair could not be decided; text says why). The feature fields are CadaclysmClosest's, flat: what each point lies on, by the kernel's id and the CadaclysmSolid.edges index; for a penetrating or refused pair there is no closest point, so kind_a and kind_b are "none" and index_* and edge_* are none.
CadaclysmClash.solid() and CadaclysmClash.intersect() are built on demand, from the placement the pair was found at; the answer of the call that found the rows is kept alive behind every row of it until the last one is let go, freeing it only then.
CadaclysmClash.a
var a: int # read-only
The first part's index: in the one set, or in the collider (then a < b); in clash with two sets, an index into parts.
CadaclysmClash.b
var b: int # read-only
The second part's index; with two sets, an index into others.
CadaclysmClash.kind
var kind: String # read-only
"penetrating", "touching", "too_close" or "refused".
CadaclysmClash.distance
var distance: float # read-only
The gap between the two boundaries; 0 for a penetrating or refused pair.
CadaclysmClash.on_a
var on_a: Vector3 # read-only
A world point on part a: the closest of the pair; for a penetrating pair the centre of the overlap's world box; the origin for a refused one.
A Vector3, of floats; raw_on_a keeps the doubles.
CadaclysmClash.on_b
var on_b: Vector3 # read-only
The matching world point on part b, as on_a.
A Vector3, of floats; raw_on_b keeps the doubles.
CadaclysmClash.kind_a
var kind_a: String # read-only
What on_a lies on, as CadaclysmClosest.kind_a: "face", "edge" or "vertex"; "none" for a penetrating or refused pair.
CadaclysmClash.index_a
var index_a: int # read-only
The kernel's id for part a's feature; none for a penetrating or refused pair.
CadaclysmClash.edge_a
var edge_a: int # read-only
Part a's edge as the index CadaclysmSolid.edges uses, as CadaclysmClosest.edge_a; none for a face, a vertex, an edge the fillet table does not hold, and a penetrating or refused pair.
CadaclysmClash.index_b
var index_b: int # read-only
The kernel's id for part b's feature, as index_a.
CadaclysmClash.refined
var refined: bool # read-only
Whether the distance was measured on the exact surfaces, as CadaclysmClosest.refined; false for a penetrating or refused pair.
CadaclysmClash.depth
var depth: float # read-only
The thinnest side of a penetrating pair's overlap box; 0 for any other.
CadaclysmClash.text
var text: String # read-only
Why a refused pair could not be decided; empty otherwise.
CadaclysmClash.solid()
func solid() -> CadaclysmSolid
The exact shared volume of this penetrating pair, at the placement it was found at, as a new CadaclysmSolid. returns null, false or an empty value (the reason in Cadaclysm.last_error()) for a pair that is not penetrating.
CadaclysmClash.intersect()
func intersect() -> CadaclysmIntersection
Where this pair's two parts cross or coincide at the placement it was found at, as CadaclysmSolid.intersect() reports it: a touching pair's shared face is an overlap region. returns null, false or an empty value (the reason in Cadaclysm.last_error()) for a refused pair.
raw_on_a and raw_on_b Godot only
var raw_on_a: PackedFloat64Array # read-only
var raw_on_b: PackedFloat64Array # read-only
CadaclysmClash.on_a and CadaclysmClash.on_b as three doubles each, where the properties hold Vector3s of floats.
CadaclysmSweptClash
class CadaclysmSweptClash extends RefCounted
One pair CadaclysmBlacksmith.swept_clash() or CadaclysmCollider.swept_clash() found to clash somewhere on the path, as plain data: when it first came within the clearance, the CadaclysmClash there, and every time range it stays in clash. Times are in pose units: pose k is at time k, and a time between two poses is the fraction of the way from one to the next.
CadaclysmSweptClash.a
var a: int # read-only
The first part's index: in the one set, or in the collider (then a < b); in swept_clash with two sets, an index into parts.
CadaclysmSweptClash.b
var b: int # read-only
The second part's index; with two sets, an index into others.
CadaclysmSweptClash.first_time
var first_time: float # read-only
The first time the pair came within the clearance, found to within the tolerance over the pair's speed; for a refused pair, the time it was refused at.
CadaclysmSweptClash.first
var first: CadaclysmClash # read-only
The CadaclysmClash at first_time — its kind, distance, points, features and depth — at the frames the motion places the two parts at that time, so its CadaclysmClash.solid() and CadaclysmClash.intersect() rebuild the contact there. A pair refused on the way (a part that will not mesh closed, or more than max_steps tests) has a "refused" first, whose text says why.
CadaclysmSweptClash.intervals
var intervals: Array[PackedFloat64Array] # read-only
The time ranges the pair stays in clash, as (start, end) pairs, ascending and disjoint; the first starts at first_time. An end is found to within resolution while the parts share volume, and two ranges closer than that may be one; a range across a pose is one range. Empty for a refused pair.
An Array of PackedFloat64Arrays, [start, end] each, in doubles: a Vector2 would hold floats.
CadaclysmCollider
class CadaclysmCollider extends RefCounted
Parts meshed once, asked pose after pose which of them interfere: solids at rest, meshed at tolerance (0.05 by default); groups one group index per solid (null: each solid its own group — CadaclysmCollider.check() then takes one frame per solid, and refuses a groups of any other length); allowed pairs of part indices never tested (designed contacts, by part index, flat: (a0, b0, a1, b1, ...)). Close it when done, or let the language's scope do it; see Lifetimes.
CadaclysmCollider.group_count
var group_count: int # read-only
How many groups this collider has — the highest group index past the constructor, plus one.
CadaclysmCollider.stats()
func stats() -> CadaclysmColliderStats
Counts of the last CadaclysmCollider.check() call, as a CadaclysmColliderStats (all zero before the first one).
CadaclysmCollider.check()
func check(frames: Array, share_k: int = 0, share_n: int = 0) -> Variant
The pairs that interfere, or could not be decided, with each group placed at its matching frame in frames (one CadaclysmFrame, or twelve numbers, per group, in group order), as CadaclysmCollisionHit values. share: null, every pair past the box filters is decided now; (k, n), only those whose index is k modulo n — the shares of one pose are disjoint and cover it, so a caller splits one pose's work across n workers and puts the answers back together. Overlap is all check answers; the parts that touch or lie within a clearance of each other are CadaclysmCollider.clash()'s. frames not the collider's own CadaclysmCollider.group_count, a frame that is not twelve finite numbers or not rigid, or a share with k >= n, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
check(frames, share_k, share_n): share_n 0 (the default) is share null, decide every pair now.
CadaclysmCollider.clash()
func clash(frames: Array, clearance: float = 0.0, share_k: int = 0, share_n: int = 0) -> Variant
Every pair of parts that penetrates, touches or lies within clearance of the other, as CadaclysmClash rows in pair order, with each group placed at its matching frame in frames (as CadaclysmCollider.check(), which answers overlap alone). The four kinds, their order of decision and the clearance are CadaclysmBlacksmith.clash()'s; the tolerance is the one the collider was built with. share as for check: the rows of the shares of one pose are disjoint and cover it. A pair's distance is measured on a closest mesh of each part, built at a third of the tolerance the first time a pair needs it and kept for the collider's lifetime, so a later pose pays only the measuring. clearance negative or not finite, the wrong number of frames, a frame that is not twelve finite numbers or not rigid, or a share with k >= n returns null, false or an empty value (the reason in Cadaclysm.last_error()). The motion between poses is CadaclysmCollider.swept_clash()'s question.
clash(frames, clearance, share_k, share_n): share_n 0 (the default) is share null, decide every pair now.
CadaclysmCollider.swept_clash()
func swept_clash(poses: Array, clearance: float = 0.0, resolution: float = 1e-3, max_steps: int = 100000, share_k: int = 0, share_n: int = 0) -> Variant
Every pair of parts that penetrates, touches or comes within clearance of the other anywhere on the path through poses — not only at the poses — as CadaclysmSweptClash rows in pair order, each with the first time it does and the time ranges it stays in clash. poses is two or more poses, each the frames CadaclysmCollider.clash() takes (one per group); time runs in pose units, pose k at time k.
Between two poses each group moves rigidly about a pivot, the centre of its rest box: the pivot on the straight line between its two places, the rotation turning at a steady rate the shorter way round, so at each pose a group is exactly where that pose puts it. A part swinging about a far hinge cuts the chord between two poses: add poses where the true path matters.
The answer is not sampled. Each pair is stepped by conservative advancement: the gap is measured, and the next step is as long as the gap allows at the fastest the two parts can close on each other, so the guarantee is that no moment where the true gap is below clearance less the tolerance (for clearance 0: no penetration deeper than the tolerance) falls between two steps, and the first time is found to within the tolerance over that speed. While the parts share volume, how deep they are bounds how long they must stay so. resolution (in (0, 1], a fraction of a segment, 1e-3 by default) is how closely an interval's end is found; max_steps (100,000 by default) the tests one pair may take over the whole path — a pair that needs more, typically a thin part grazing another at speed, is a "refused" row whose first.text says so; raise it or add poses.
Pairs come from the swept boxes first: each part's box over a segment, both poses' boxes joined and grown by how far its rotation can carry a point off the chord. A pair whose swept boxes never come within the clearance is not stepped at all. share as for CadaclysmCollider.check(), over the pairs whose swept boxes meet: the shares of one call are disjoint and cover it. The pose caches CadaclysmCollider.check() and CadaclysmCollider.clash() keep are neither read nor filled (each time on the path is a new placement); the parts' meshes are made as those calls make them, and kept.
Fewer than two poses, a pose with the wrong number of frames, a frame that is not twelve finite numbers or not rigid, clearance negative or not finite, resolution outside (0, 1], max_steps 0, or a share with k >= n returns null, false or an empty value (the reason in Cadaclysm.last_error()).
swept_clash(poses, clearance, resolution, max_steps, share_k, share_n): share_n 0 (the default) is share null, decide every pair now.
CadaclysmCollider.close()
func close() -> void
Free this handle now. The garbage collector, or the language's scope, does it otherwise.
create Godot only
static func create(solids: Array[CadaclysmSolid], tolerance: float = 0.05, groups: PackedInt32Array = PackedInt32Array(), allowed: PackedInt32Array = PackedInt32Array()) -> CadaclysmCollider
Python's Collider(solids, tolerance, groups, allowed), tolerance defaulted to 0.05 and groups/allowed to empty arrays (each solid its own group, no allowed pairs). (new is GDScript's own, so the constructor is create.)
CadaclysmThicknessGauge
class CadaclysmThicknessGauge extends RefCounted
Wall thickness over solids, measured against each other: each solid meshed once at tolerance — absolute, in model units (0.01 by default) — and indexed, then asked reading after reading. A reading's body is the solid's index in solids. The gauge keeps its own reference to the bodies, so it answers on after they are closed. Close it when done, or let the language's scope do it; see Lifetimes. A tolerance not positive and finite returns null, false or an empty value (the reason in Cadaclysm.last_error()).
The rule reads the measuring mesh (CadaclysmThicknessGauge.mesh()). From a point P the thickness is the distance to the nearest triangle that opposes P's own face (their normals more than 89 degrees apart) with P on or behind its plane — not a ray cast along the normal, so a box's corner reads the plate's thickness, not the diagonal. A triangle with a vertex exactly at P is skipped; where one of those meets P's own face at an interior angle under sharp_angle radians, P is a knife edge and reads 0. A point with no such triangle, or one further than maximum, gives no reading: readings are dropped, not clamped. Each reading then carries the opposite point refined onto its exact face (CadaclysmThickness.exact_thickness), and the diameter of the largest ball tangent at P that holds none of the surfaces (CadaclysmThickness.sphere). The two differ on a tilted wall: the rule reads the perpendicular foot, so a right wedge reads 3.54 at a point where the ball that fits there is 4.14 across; the ball is the wall's inscribed thickness.
CadaclysmThicknessGauge.tolerance
var tolerance: float # read-only
The tolerance the gauge meshed its bodies at.
CadaclysmThicknessGauge.body_count
var body_count: int # read-only
How many bodies the gauge measures: the length of solids it was built from.
CadaclysmThicknessGauge.thickness()
func thickness(maximum: float, sharp_angle: float = 0.0) -> Variant
One CadaclysmThickness per measuring-mesh vertex that reads within maximum, by body then vertex; sharp_angle (radians, 0 by default) sets which vertices are knife edges. maximum not positive and finite, or sharp_angle negative or not finite, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmThicknessGauge.thickness_at()
func thickness_at(body: int, face: int, point: Variant, maximum: float, sharp_angle: float = 0.0) -> CadaclysmThickness
The reading at point's foot on face face of body body, its vertex null: the foot read against the exact tangent plane there, so a wall is measured between the mesh's vertices too. null where the foot lies off the face, or the wall there is thicker than maximum. A body or a face past the end, a point not finite, or a bad maximum or sharp_angle returns null, false or an empty value (the reason in Cadaclysm.last_error()).
point is a Vector3 or three numbers; body and face are ints, one negative or past a u32 refused (thickness_gauge_at: body is out of range: N), a point of another length too (thickness_gauge_at: a point is 3 numbers, got N). null for none leaves Cadaclysm.last_error() empty.
CadaclysmThicknessGauge.thickness_at_face()
func thickness_at_face(body: int, face: int, at: Variant, maximum: float) -> CadaclysmFaceThickness
One figure for face face of body body, as a CadaclysmFaceThickness, the other bodies measured with it: at at's foot on the face, or with no at over the face's vertices. maximum has no default. null where nothing on the face reads within maximum, or at's foot lies off the face. A body or a face past the end, an at not finite, or maximum not positive and finite returns null, false or an empty value (the reason in Cadaclysm.last_error()).
thickness_at_face(body, face, at, maximum): at is required and comes before maximum; pass null for none. at is a Vector3 or three numbers. null for none leaves Cadaclysm.last_error() empty.
CadaclysmThicknessGauge.mesh()
func mesh(body: int) -> CadaclysmThicknessMesh
Body body's measuring mesh, as a CadaclysmThicknessMesh: the mesh a reading's vertex indexes, copied out, so it outlives the gauge. A body past the end returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmThicknessGauge.close()
func close() -> void
Free this handle now. Leaving a with block or the garbage collector does the same.
There is no with block: the last reference going, or close(), frees it. Idempotent; a closed gauge refuses with thickness_gauge: closed.
create Godot only
static func create(solids: Array[CadaclysmSolid], tolerance: float = 0.01) -> CadaclysmThicknessGauge
Python's ThicknessGauge(solids, tolerance), tolerance defaulted to 0.01. (new is GDScript's own, so the constructor is create.)
CadaclysmThickness
class CadaclysmThickness extends RefCounted
One wall-thickness reading on a solid, as plain data: what CadaclysmThicknessGauge.thickness(), CadaclysmThicknessGauge.thickness_at() and CadaclysmBlacksmith.thickness() return. Points are three numbers.
CadaclysmThickness.body
var body: int # read-only
The body read: its index among the gauge's solids.
CadaclysmThickness.vertex
var vertex: int # read-only
The vertex of that body's CadaclysmThicknessGauge.mesh() the reading is at; null for a reading at a point (CadaclysmThicknessGauge.thickness_at()).
-1 for a reading at a point, where the others have a none.
CadaclysmThickness.point
var point: Vector3 # read-only
Where the wall is read.
A Vector3, so floats: compare to 1e-5, not 1e-9. raw_point gives the three doubles.
CadaclysmThickness.thickness
var thickness: float # read-only
The rule's figure on the measuring mesh: the distance from point to opposite; 0 on a knife edge.
CadaclysmThickness.opposite
var opposite: Vector3 # read-only
The nearest point on the opposing triangle; point itself on a knife edge.
A Vector3, so floats; raw_opposite gives the three doubles.
CadaclysmThickness.opposite_body
var opposite_body: int # read-only
The body opposite lies on: the gauge's bodies are measured against each other.
CadaclysmThickness.opposite_face
var opposite_face: int # read-only
The face of opposite_body that opposite lies on.
CadaclysmThickness.knife
var knife: bool # read-only
Whether point is a knife edge: thickness 0, opposite equal to point.
CadaclysmThickness.exact_thickness
var exact_thickness: float # read-only
The distance from point to exact_opposite: the figure to compare with a closed form.
CadaclysmThickness.exact_opposite
var exact_opposite: Vector3 # read-only
opposite moved onto its face's exact surface, where that foot lies within the tolerance of it and inside the face's trims; otherwise opposite itself.
CadaclysmThickness.sphere
var sphere: float # read-only
The diameter of the largest ball tangent at point that holds none of the surfaces — the wall's inscribed thickness, which on a tilted wall is more than thickness; null where no ball up to maximum is bounded, and 0 on a knife edge.
NaN where there is none, with has_sphere false; sphere is a double, not a float.
has_sphere Godot only
var has_sphere: bool # read-only
Whether CadaclysmThickness.sphere is a figure: false where Python's sphere is None, then sphere is NaN.
raw_point, raw_opposite and raw_exact_opposite Godot only
var raw_point: PackedFloat64Array # read-only
var raw_opposite: PackedFloat64Array # read-only
var raw_exact_opposite: PackedFloat64Array # read-only
CadaclysmThickness.point, CadaclysmThickness.opposite and CadaclysmThickness.exact_opposite as three doubles each, where the properties hold Vector3s of floats.
CadaclysmFaceThickness
class CadaclysmFaceThickness extends RefCounted
One face's wall thickness, as plain data: what CadaclysmThicknessGauge.thickness_at_face() and CadaclysmSolid.thickness_at_face() return when something on the face reads. Over the face's vertices, thickness is the median of their exact readings, each vertex counting once (by vertex count, not by area); at a point, thickness, min and max are the one reading. The figure is meant for plate-like faces: by the rule a solid cylinder's side face (radius 5) reads about 7.07, 5√2, the chord to the first opposing facet past a quarter turn — not its diameter, and not uniform.
CadaclysmFaceThickness.thickness
var thickness: float # read-only
The median of the face's readings, or the reading at the point asked.
CadaclysmFaceThickness.uniform
var uniform: bool # read-only
Whether max - min is within the gauge's tolerance; a very gentle taper reads as uniform.
CadaclysmThicknessMesh
class CadaclysmThicknessMesh extends RefCounted
A body's measuring mesh, copied out of the gauge: what CadaclysmThicknessGauge.mesh() returns. Its vertices are split per face — no vertex is shared between two faces — so each carries its own face's exact normal.
CadaclysmThicknessMesh.positions
var positions: PackedVector3Array # read-only
One point per vertex; a reading's vertex indexes them.
A PackedVector3Array, so floats: compare to 1e-5, not 1e-9.
CadaclysmThicknessMesh.normals
var normals: PackedVector3Array # read-only
One unit outward normal per vertex, its face's exact surface normal.
A PackedVector3Array of floats.
CadaclysmThicknessMesh.triangles
var triangles: PackedInt32Array # read-only
Three vertex indices per triangle.
A flat PackedInt32Array, three indices a triangle: triangle t is triangles[3 * t] to triangles[3 * t + 2].
CadaclysmThicknessMesh.faces
var faces: PackedInt32Array # read-only
The face of the body each triangle lies on.
A PackedInt32Array, one entry a triangle.
CadaclysmMeshThickness
class CadaclysmMeshThickness extends RefCounted
One reading on a plain mesh, as plain data: what CadaclysmBlacksmith.mesh_thickness() returns. Points are three numbers.
CadaclysmMeshThickness.mesh
var mesh: int # read-only
The mesh read: its index among the meshes passed.
CadaclysmMeshThickness.vertex
var vertex: int # read-only
The vertex of that mesh the reading is at.
CadaclysmMeshThickness.thickness
var thickness: float # read-only
The distance from point to opposite; 0 on a knife edge.
CadaclysmMeshThickness.point
var point: Vector3 # read-only
The vertex's position.
A Vector3, so floats; raw_point gives the three doubles.
CadaclysmMeshThickness.opposite
var opposite: Vector3 # read-only
The nearest point on the opposing triangle; point itself on a knife edge.
A Vector3, so floats; raw_opposite gives the three doubles.
CadaclysmMeshThickness.opposite_mesh
var opposite_mesh: int # read-only
The mesh opposite lies on: the meshes are measured against each other.
CadaclysmMeshThickness.opposite_triangle
var opposite_triangle: int # read-only
The triangle of opposite_mesh that opposite lies on.
CadaclysmMeshThickness.knife
var knife: bool # read-only
Whether the vertex is a knife edge: thickness 0, opposite equal to point.
raw_point and raw_opposite Godot only
var raw_point: PackedFloat64Array # read-only
var raw_opposite: PackedFloat64Array # read-only
CadaclysmMeshThickness.point and CadaclysmMeshThickness.opposite as three doubles each, where the properties hold Vector3s of floats.
CadaclysmRTree
class CadaclysmRTree extends RefCounted
A spatial index over boxes with ids (an R\*-tree): which entries a box meets, which are within a distance of a point or nearest it, which a ray passes through, and which pairs of boxes meet, between two trees or within one. RTree() is an empty tree; CadaclysmRTree.from_boxes(), CadaclysmRTree.from_points() and CadaclysmRTree.from_triangles() pack a whole set at once, and CadaclysmSolid.face_tree() gives one over a solid's faces. The tree changes in place (CadaclysmRTree.insert(), CadaclysmRTree.remove()) and stays balanced; its length is how many entries it holds.
An entry is an id and a box. Ids are the caller's own and may repeat: two entries may share an id, or an id and a box, and the same (id, box) twice is two entries, found twice. A box is (min, max) — two (x, y, z) triples — a CadaclysmBox, or 6 numbers [minx, miny, minz, maxx, maxy, maxz]; a point stands for a zero box. A box with a NaN or infinite coordinate, or min above max on an axis, is not a box. Touching boxes meet, everywhere: a box's faces count.
Answers come in a fixed order, so the same entries give the same answer whatever order they arrived in and however the tree was built: CadaclysmRTree.search() ids ascending, CadaclysmRTree.within() and CadaclysmRTree.nearest() by distance then id, pairs ascending. Distances are Euclidean from the point to the box, 0 inside it. slack is the largest gap between two boxes that still pair: two boxes at most slack apart on every axis pair, so 0 is touching. Calls on one tree must not overlap from two threads. Close it when done, or let the language's scope do it; see Lifetimes.
CadaclysmRTree.from_boxes()
static func from_boxes(entries: Array) -> CadaclysmRTree
A tree over (id, box) pairs at once, packed (sort-tile-recursive): fuller and faster to query than the same entries inserted one by one, and the same tree for any order of them. The first entry whose box is not a box returns null, false or an empty value (the reason in Cadaclysm.last_error()), by index.
CadaclysmRTree.from_points()
static func from_points(points: Variant) -> CadaclysmRTree
A tree over points, each a zero box whose id is its index. The first point with a NaN or infinite coordinate returns null, false or an empty value (the reason in Cadaclysm.last_error()), by index.
CadaclysmRTree.from_triangles()
static func from_triangles(positions: Variant, triangles: Variant) -> CadaclysmRTree
A tree over a mesh's triangles in one call: triangles an (m, 3) sequence of indices into positions (an (n, 3) sequence of points), one entry per triangle, its id the triangle's index and its box its three corners' box. The first corner past the points (triangle 1 names point 9 of 4) or at a point with a NaN or infinite coordinate returns null, false or an empty value (the reason in Cadaclysm.last_error()), by triangle and point; points no triangle uses are not checked.
CadaclysmRTree.insert()
func insert(id: int, box_: Variant) -> bool
func insert_point(id: int, point: Variant) -> bool
Add the entry (id, box), box a box or a point. A box that is not a box, or a point that is not finite, returns null, false or an empty value (the reason in Cadaclysm.last_error()) and leaves the tree as it was.
insert(id, box) takes a box — a CadaclysmBox, [min, max] (two points) or six numbers — and insert_point(id, point) a point (a Vector3 or three numbers), GDScript having no overloads. Ids are ints: one outside 0 to 4294967295 is refused before the call. false on failure, with the reason in Cadaclysm.last_error().
CadaclysmRTree.remove()
func remove(id: int, box_: Variant) -> bool
func remove_point(id: int, point: Variant) -> bool
Take out one entry equal to (id, box) and say whether there was one. remove needs the box the entry was inserted with, compared coordinate by coordinate (a point's is its zero box): the id alone does not find it. None found is False, not an error; with duplicates one goes per call. A box that is not a box returns null, false or an empty value (the reason in Cadaclysm.last_error()).
remove(id, box) and remove_point(id, point), as insert and insert_point take them. None found is false with Cadaclysm.last_error() empty; a refusal is false with the reason there.
CadaclysmRTree.bounds
var bounds: Variant # read-only
The union of every entry's box as (min, max), or null for an empty tree.
CadaclysmRTree.search()
func search(box_: Variant) -> PackedInt64Array
The ids of every entry whose box meets box — touching counts — ascending, one per entry (a repeated id comes back as often as it was inserted). A box that is not a box returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmRTree.within()
func within(point: Variant, r: float) -> Array[CadaclysmRTreeHit]
Every entry whose box is within r of point (0 inside the box; exactly r counts), as (id, distance) pairs by distance then id. A point not finite, or an r negative or NaN, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmRTree.nearest()
func nearest(point: Variant, k: int) -> Array[CadaclysmRTreeHit]
The k entries whose boxes are nearest point, as (id, distance) pairs by distance then id — the smaller ids win a tie at the k-th place; every entry when k is over the count, none for k 0 or an empty tree. A point not finite, or a k above 1,000,000, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmRTree.ray()
func ray(origin: Variant, direction: Variant, max_t: float = f64.INFINITY) -> Array[CadaclysmRTreeHit]
Every entry whose box the ray origin + t * direction, 0 <= t <= max_t, meets, as (id, t) pairs by t then id: t is where the ray enters the box, 0 when origin is inside it. Touching counts — a ray grazing a face or an edge, or running along one, meets the box. t is in units of direction's length, which is not normalised; max_t defaults to infinity. The boxes are what is tested: for a triangle or a face the caller tests the hits' own geometry. An origin or direction not finite, a zero direction, or a max_t negative or NaN returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmRTree.overlaps()
func overlaps(other: CadaclysmRTree, slack: float = 0.0) -> Array[CadaclysmRTreePair]
Every pair (a, b), a an entry of this tree and b one of other, whose boxes are at most slack apart on every axis (0 by default: touching), ascending. A slack negative or NaN returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmRTree.self_overlaps()
func self_overlaps(slack: float = 0.0) -> Array[CadaclysmRTreePair]
Every unordered pair of distinct entries at most slack apart on every axis, once each as (smaller id, larger id), ascending — an id pairs with itself only where two entries share it. A slack negative or NaN returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmRTree.close()
func close() -> void
Free this handle now. Leaving a with block or the garbage collector does the same.
create Godot only
static func create() -> CadaclysmRTree
Python's RTree(): an empty tree. (new is GDScript's own, as CadaclysmFrame.create is, so the constructor is create.)
count Godot only
func count() -> int
How many entries the tree holds — Python's len(tree); 0 on a closed tree, with the reason in Cadaclysm.last_error().
CadaclysmRTreeHit Godot only
class CadaclysmRTreeHit extends RefCounted
var id: int # read-only
var distance: float # read-only
One answer of CadaclysmRTree.within() or CadaclysmRTree.nearest(), where Python has an (id, distance) tuple: the entry's id and the distance from the point asked to its box, 0 inside it.
CadaclysmRTreePair Godot only
class CadaclysmRTreePair extends RefCounted
var a: int # read-only
var b: int # read-only
One answer of CadaclysmRTree.overlaps() or CadaclysmRTree.self_overlaps(), where Python has an (a, b) tuple: the two entries' ids, this tree's first on overlaps, the smaller first on self_overlaps.
CadaclysmInterpolator
class CadaclysmInterpolator extends RefCounted
A list of samples read at a fractional index, as Rhino's Interpolator: animation keys, a value along a pattern, a smoothed profile of measurements. Interpolator(samples, cyclic) takes numbers, or equal-length sequences of numbers — 2D or 3D points, or vectors of any dimension; samples of unequal lengths are refused before the call. Its length is how many samples it holds.
t is a fractional sample index: t = 2 is sample 2, t = 2.5 halfway between samples 2 and 3. An open list clamps t to [0, length - 1] and stops on its first and last samples, an end sample standing in for its missing neighbour; a cyclic list wraps t with period length (t = length is sample 0, t = -0.5 halfway between the last sample and the first).
The five modes are Paul Bourke's formulas, in the notation mu the fraction past sample i and y0 ... y3 the samples at i - 1 ... i + 2; every mode returns the sample itself at a whole t. A dimension-1 interpolator answers numbers, others tuples, each component read on its own (every mode is a fixed linear combination of at most four samples). A sample that is NaN or infinite, no samples at all, or a t that is NaN or infinite returns null, false or an empty value (the reason in Cadaclysm.last_error()); a mode name not among the five is refused before the call. It never changes once made. Close it when done, or let the language's scope do it; see Lifetimes.
CadaclysmInterpolator.dimension
var dimension: int # read-only
How many numbers a sample holds: 1 answers numbers, more answers tuples.
CadaclysmInterpolator.cyclic
var cyclic: bool # read-only
Whether t wraps round the list (true) or is clamped to its ends (false).
CadaclysmInterpolator.at()
func at(t: float, mode: int = 1) -> PackedFloat64Array
The value at the fractional index t by mode — "nearest", "linear" (the default), "cosine", "cubic" or "catmull_rom". A t that is NaN or infinite returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Answers a PackedFloat64Array of dimension numbers, whatever the dimension (empty on a refusal); mode a MODE_* constant, MODE_LINEAR its default. sample answers an Array[PackedFloat64Array].
CadaclysmInterpolator.sample()
func sample(ts: PackedFloat64Array, mode: int = 1) -> Array[PackedFloat64Array]
The values at every t of ts by mode, as CadaclysmInterpolator.at() reads each, in one call. A value of t that is NaN or infinite (by its index), or more than 1,000,000 of them, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmInterpolator.nearest()
func nearest(t: float) -> PackedFloat64Array
The sample at floor(t + 1/2) — a half rounds up — after the clamp or wrap.
CadaclysmInterpolator.linear()
func linear(t: float) -> PackedFloat64Array
Straight between the samples either side of t: y1 + (y2 - y1) mu.
CadaclysmInterpolator.cosine()
func cosine(t: float) -> PackedFloat64Array
Linear at (1 - cos(pi mu)) / 2 instead of mu: an ease, flat at every sample.
CadaclysmInterpolator.cubic()
func cubic(t: float) -> PackedFloat64Array
Bourke's cubic over the four samples about t: a0 mu^3 + a1 mu^2 + a2 mu + y1 with a0 = y3 - y2 - y0 + y1, a1 = y0 - y1 - a0, a2 = y2 - y0. Through every sample, but not C1, and it does not reproduce a straight ramp.
CadaclysmInterpolator.catmull_rom()
func catmull_rom(t: float) -> PackedFloat64Array
The Catmull-Rom spline over the four samples about t: through every sample, C1, its tangent at each (y2 - y0) / 2. It reproduces straight ramps and parabolas sampled at whole t.
CadaclysmInterpolator.close()
func close() -> void
Free this handle now. Leaving a with block or the garbage collector does the same.
create Godot only
static func create(samples: PackedFloat64Array, dimension: int = 1, cyclic: bool = false) -> CadaclysmInterpolator
Python's Interpolator(samples, cyclic), the samples one PackedFloat64Array of dimension numbers a sample (1 by default: numbers). A count of numbers that is not whole samples is refused before the call (interpolator: samples differ in length), as is a dimension outside 0 to 4294967295. The modes are the class's constants MODE_NEAREST, MODE_LINEAR, MODE_COSINE, MODE_CUBIC and MODE_CATMULL_ROM (0 to 4), where Python has the names; another int is refused before the call. (new is GDScript's own, as CadaclysmFrame.create is, so the constructor is create.)
count Godot only
func count() -> int
How many samples it holds — Python's len(interpolator); 0 on a closed one, with the reason in Cadaclysm.last_error().
CadaclysmAnimation
class CadaclysmAnimation extends RefCounted
Keyframe tracks over named targets: what moves, turns, scales, shows, tints or ghosts, and when. A host plays it by asking, at a time t in seconds, for each target's CadaclysmAnimation.placement_at() (a 4x4 matrix) and each track's CadaclysmAnimation.value_at(). Animation() makes an empty one; tracks are added with CadaclysmAnimation.add_track() or one of the channel helpers.
A track drives one channel of one target — any non-empty name: a part, a node, a light — through keys, (time, value) pairs with times in seconds, strictly increasing. There are seven channels, each with its own kind of key value. A "translate" key carries an offset (x, y, z). A "rotate" key carries an angle in degrees about the track's axis through its pivot (right-handed; see CadaclysmAnimation.set_pivot()). A "scale" key carries factors (sx, sy, sz) about the track's pivot. A "visible" key carries a number, shown when above 0.5, and a "ghost" key one, ghosted when above 0.5; both always hold, as "nearest". A "colour" key carries (r, g, b). A "value" key carries any number, or a list of numbers of any length — a dial, a gauge, a host's own signal.
The mode reads between keys, as the CadaclysmInterpolator's five: "nearest" holds the latest key at or before t (a key at 2 takes effect at 2), "linear" (the default), "cosine" (linear on a cosine ease), "cubic" (Bourke's cubic on the four keys about t at the segment's fraction — the sampled-curve form; prefer Catmull-Rom for uneven keys) and "catmull_rom" (the non-uniform Hermite: C1, its tangents in value per second; evenly spaced keys equal the interpolator's). Before the first key a track reads its first value, after the last its last; one key is a constant. A track's duration is its last key time, and the animation's is the latest over all its tracks (0 with none).
A target's placement is its scales, then its rotates, then its translates, applied in that order, composed T_n ... T_1 * R_m ... R_1 * S_k ... S_1 (the first added of each kind applied first), a rotate as Tr(p) * Rot(axis, angle) * Tr(-p) and a scale as Tr(p) * diag(s) * Tr(-p) about its pivot p. A target with no placement track answers the identity. Targets are numbered in order of first appearance. The View plays an animation in a later release.
A track the kernel refuses — an empty target, no keys, a time that is negative, NaN or not increasing, a value that is NaN or infinite, a dimension the channel does not take, a value track of dimension 0, more than 1,000,000 keys — returns null, false or an empty value (the reason in Cadaclysm.last_error()) and leaves the animation unchanged. A channel or mode name not among those above, or keys whose values differ in length, returns null, false, -1 or an empty value (the reason in Cadaclysm.last_error()) before the call, and leaves it unchanged too. Close it when done, or let the language's scope do it; see Lifetimes.
Where the text above says Animation(), a name or a string, Godot has CadaclysmAnimation.create(), integer constants (CHANNEL_*, CadaclysmInterpolator.MODE_*) and [time, value] key arrays; its refusals return -1, false, null or an empty value with the reason in Cadaclysm.last_error(), and close() frees the handle.
CadaclysmAnimation.add_track()
func add_track(target: String, channel: int, keys: Variant, mode: int = 1) -> int
Add a track driving channel of target through keys by mode ("linear" by default) and return its index, counting from 0 in the order added. A value that is a number is dimension 1; the values of one track all have the same length. A refusal returns null, false or an empty value (the reason in Cadaclysm.last_error()), with the call's name in front (animation_add_track: times must increase: key 2 at 1 after 1.5).
add_track(target, channel, keys, mode = 1): channel is a CadaclysmAnimation.CHANNEL_* constant (0 to 6) and mode a CadaclysmInterpolator.MODE_* (MODE_LINEAR by default), not the strings above; an int outside them is refused before the call (animation: channel 7 is not a channel, animation: mode 5 is not a mode). Keys are [time, value] arrays, the value a number or an array of numbers. Returns the track index, or -1 on a refusal.
CadaclysmAnimation.translate()
func translate(target: String, keys: Variant, mode: int = 1) -> int
A translate track: keys (time, (x, y, z)), an offset in model units.
Keys are [time, Vector3] or [time, [x, y, z]].
CadaclysmAnimation.rotate()
func rotate(target: String, keys: Variant, pivot: PackedFloat64Array = PackedFloat64Array(), axis: PackedFloat64Array = PackedFloat64Array(), mode: int = 1) -> int
A rotate track: keys (time, degrees), about axis (+Z by default, any non-zero vector, taken as a direction) through pivot (the origin by default), right-handed. A pivot or axis that is not three numbers returns null, false, -1 or an empty value (the reason in Cadaclysm.last_error()); one with an entry that is NaN or infinite, or an axis too short to point anywhere, returns null, false or an empty value (the reason in Cadaclysm.last_error()). Either adds no track.
rotate(target, keys, pivot = [], axis = [], mode = 1): keys are [time, degrees]; pivot and axis are arrays of three numbers (doubles, as the rest of the module takes points), and the empty array is the default (the origin, +Z). A pivot or axis of another length is refused before the call (animation: pivot is 2 numbers, not 3), returning -1.
CadaclysmAnimation.scale()
func scale(target: String, keys: Variant, pivot: PackedFloat64Array = PackedFloat64Array(), mode: int = 1) -> int
A scale track: keys (time, (sx, sy, sz)), about pivot (the origin by default). A pivot that is not three numbers returns null, false, -1 or an empty value (the reason in Cadaclysm.last_error()); one with an entry that is NaN or infinite returns null, false or an empty value (the reason in Cadaclysm.last_error()). Either adds no track.
scale(target, keys, pivot = [], mode = 1): keys are [time, Vector3] or [time, [sx, sy, sz]]; pivot is an array of three numbers, empty for the origin. One of another length is refused before the call (animation: pivot is 2 numbers, not 3), returning -1.
CadaclysmAnimation.visible()
func visible(target: String, keys: Variant) -> int
A visibility track: keys (time, number), shown when above 0.5. Always read as "nearest".
Keys are [time, number].
CadaclysmAnimation.colour()
func colour(target: String, keys: Variant, mode: int = 1) -> int
A colour track: keys (time, (r, g, b)).
Keys are [time, Color] (read as its r, g, b) or [time, [r, g, b]].
CadaclysmAnimation.ghost()
func ghost(target: String, keys: Variant) -> int
A ghost track — a part shown faded, as a host draws one: keys (time, number), ghosted when above 0.5. Always read as "nearest".
Keys are [time, number].
CadaclysmAnimation.value()
func value(target: String, keys: Variant, mode: int = 1) -> int
A free value track: keys (time, number) or (time, numbers) of any length, the same for every key.
Keys are [time, number] or [time, [numbers]] of any length.
CadaclysmAnimation.set_pivot()
func set_pivot(track: int, pivot: PackedFloat64Array, axis: PackedFloat64Array = PackedFloat64Array()) -> bool
Set the pivot and axis (three numbers each; the axis +Z unless given) of the rotate or scale track track. A pivot or axis that is not three numbers returns null, false, -1 or an empty value (the reason in Cadaclysm.last_error()). Any other kind of track, an entry that is NaN or infinite, or a rotate axis too short to point anywhere, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
set_pivot(track, pivot, axis = []): arrays of three numbers, empty for the origin and +Z. One of another length is refused before the call (animation: axis is 4 numbers, not 3), returning false.
CadaclysmAnimation.duration
var duration: float # read-only
The latest key time over all tracks, in seconds; 0 with no tracks.
A duration property, a float.
CadaclysmAnimation.targets
var targets: PackedStringArray # read-only
The target names, in order of first appearance. The index of a name is the index CadaclysmAnimation.placement_at() takes.
A targets property, a PackedStringArray; the track count is count(). Placement indexes count from 0.
CadaclysmAnimation.track()
func track(i: int) -> CadaclysmAnimationTrack
Track i, as it was added, as an CadaclysmAnimationTrack: its target, channel and mode names (the mode as asked, though visible and ghost evaluate as "nearest"), the key times, the key values (dimension numbers a key), the dimension, and the pivot and axis (the origin and +Z unless set). An i that is not below the track count returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Answers a CadaclysmAnimationTrack (null for an i out of range, or negative): times a PackedFloat64Array, values an Array[PackedFloat64Array] with one row of dimension numbers a key, channel and mode the integer constants, pivot and axis PackedFloat64Arrays of 3. equals compares two by value.
CadaclysmAnimation.value_at()
func value_at(track: int, t: float) -> PackedFloat64Array
The value of track track at time t, by its mode: dimension numbers. A t that is NaN or infinite, or a track out of range, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
A PackedFloat64Array of dimension numbers, an array of one at dimension 1; empty on a refusal.
CadaclysmAnimation.values_at()
func values_at(t: float) -> Array[PackedFloat64Array]
The value of every track at time t, in track order, each shaped as CadaclysmAnimation.value_at()'s; an empty list with no tracks. A t that is NaN or infinite returns null, false or an empty value (the reason in Cadaclysm.last_error()).
An Array[PackedFloat64Array], one entry a track; empty on a refusal.
CadaclysmAnimation.placement_at()
func placement_at(target: Variant, t: float) -> PackedFloat64Array
The placement of target — its name, or its index in CadaclysmAnimation.targets — at time t, as a 4x4 matrix in the View's set_placement layout: four columns of four numbers, m[col][row], the translation in the fourth column. A name that is not a target returns null, false, -1 or an empty value (the reason in Cadaclysm.last_error()); an index out of range, or a t that is NaN or infinite, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Answers 16 numbers as a PackedFloat64Array, column-major (m[col * 4 + row]); empty on a refusal. target is a String name or an int index.
CadaclysmAnimation.clone()
func clone() -> CadaclysmAnimation
An independent copy: tracks added to either never reach the other.
clone() answers a new CadaclysmAnimation, or null on a closed one.
CadaclysmAnimation.close()
func close() -> void
Free this handle now. A second call does nothing; any other call after it returns null, false or an empty value (the reason in Cadaclysm.last_error()). Leaving the scope that owns it does the same.
A second call does nothing; any other call after it fails with animation: closed in Cadaclysm.last_error(), as every Godot handle does. The last reference going frees it too.
create Godot only
static func create() -> CadaclysmAnimation
Python's Animation(): an empty animation. (new is GDScript's own, as CadaclysmFrame.create is, so the constructor is create.) Channels are the class's constants CHANNEL_TRANSLATE, CHANNEL_ROTATE, CHANNEL_SCALE, CHANNEL_VISIBLE, CHANNEL_COLOUR, CHANNEL_GHOST and CHANNEL_VALUE (0 to 6) and modes CadaclysmInterpolator's MODE_* constants, where Python has the names; another int is refused before the call. Keys are arrays of [time, value] pairs, the value a number or an array of numbers (a Vector3 or Color where it holds three). Pivots and axes are arrays of three numbers (empty for the defaults), so they keep a double's precision; one of another length is refused before the call (animation: pivot is 2 numbers, not 3). The track helpers are translate, rotate, scale, visible, colour, ghost and value.
count Godot only
func count() -> int
How many tracks it holds — Python's len(animation); 0 on a closed one, with the reason in Cadaclysm.last_error().
equals Godot only
func equals(other: Variant) -> bool
Whether another CadaclysmAnimationTrack holds the same target, channel, mode, keys, dimension, pivot and axis — Python's == on two AnimationTracks, which GDScript's own == on two objects (identity) is not. false for anything else.
CadaclysmAnimationTrack
class CadaclysmAnimationTrack extends RefCounted
One track of an CadaclysmAnimation, read back as it was given by CadaclysmAnimation.track(): a plain record, equal to another by value, that holds no handle and needs no closing.
CadaclysmAnimationTrack.channel
var channel: int # read-only
The channel's name: "translate", "rotate", "scale", "visible", "colour", "ghost" or "value".
An int: a CadaclysmAnimation.CHANNEL_* constant.
CadaclysmAnimationTrack.mode
var mode: int # read-only
The mode's name, as it was asked. A visible or ghost track reads as "nearest" whatever it says.
An int: a CadaclysmInterpolator.MODE_* constant.
CadaclysmAnimationTrack.times
var times: PackedFloat64Array # read-only
The key times, in seconds, increasing.
CadaclysmAnimationTrack.values
var values: Array[PackedFloat64Array] # read-only
The key values: numbers at dimension 1, dimension numbers a key.
An Array[PackedFloat64Array]: one row of dimension numbers a key, a row of one at dimension 1.
CadaclysmAnimationTrack.dimension
var dimension: int # read-only
How many numbers a key's value holds.
CadaclysmAnimationTrack.pivot
var pivot: PackedFloat64Array # read-only
The pivot a rotate or scale works about: the origin unless set. Any track has one.
A PackedFloat64Array of 3 numbers.
CadaclysmAnimationTrack.axis
var axis: PackedFloat64Array # read-only
The axis a rotate turns about: +Z unless set. Any track has one.
A PackedFloat64Array of 3 numbers.
Document
A model as data: a graph of nodes (profile.rect, solid.extrude, measure.mass, ...), each a blacksmith verb reading other nodes by id, with named parameters that any number can be an "=expression" of, evaluated incrementally, and edited by ops that are undoable and branch. The whole thing — nodes, parameters, history, branches — saves as JSON text (the cadaclysm-blacksmith format, version 1) and loads back to the same document.
A node has a kind, which names the verb and its inputs, and fields: a number, an "=expression" over the parameters and other nodes' values, or the id of another node to read. An expression holds numbers with units (3 mm, 45 deg), lists ([1, 2, 3 mm], range(0, 360, 60), item, slice, merge, flatten, reverse, len, polar, zip), comparisons, and, or, not and if(c, a, b); arithmetic maps over lists item by item, the shorter padded with its last item. A node given a list where a field takes one number runs once per item and gives the list of its results ("lacing": "cross" takes every combination); a value node holds one expression for others to read by its id ("=v1"). Every edit is an op — add, set, remove, rename or param — and one op is one commit. A refused op returns null, false or an empty value (the reason in Cadaclysm.last_error()) with the reason, and the document is unchanged.
The nodes are brought up to date when you read one: only the nodes an edit made stale are evaluated again, and a node that fails is reported by errors while the nodes that do not read it still answer. A node's result comes out as the language's own type: a CadaclysmSolid, a CadaclysmProfile, a CadaclysmNurbsCurve, a Subd, or a plain value.
The web build's history. The kernel wasm module carries the same document, and also a JavaScript-only history binding, cadaclysm_blacksmith_history_*, over the same commits and branches for a page that shows a timeline. It is not part of this page's wrapper surface: for now the Python members below are the history surface.
Close it when done, or let the language's scope do it; see Lifetimes. One thread at a time.
Not in this wrapper yet.
Document.load
The document that save wrote as text: its nodes, parameters, history and branches.
Not in this wrapper yet.
Document.kinds
Every node kind the library knows, one record a kind: its name, inputs, output, cost and help. Needs no document.
Not in this wrapper yet.
Document.new_bim
An empty building document: the blacksmith kinds and the bim.* ones (levels, layered walls and their joins, doors, windows, floors), holding a bim.project node whose random guid seeds every IFC GlobalId it exports.
Not in this wrapper yet.
Document.load_bim
A building document that save wrote as text, opened with the bim.* kinds.
Not in this wrapper yet.
Document.bim_kinds
Every node kind a building document knows, the blacksmith's and the bim.* ones, as kinds lists them. Needs no document.
Not in this wrapper yet.
Document.parts_catalog
Loads the parts catalogue (a directory of family files and their index) that parts.catalog nodes build their parts from: servos, bars, brackets, bearings, pulleys. Replaces the one loaded before.
Not in this wrapper yet.
Document.new_parts
An empty bench document, in millimetres: the blacksmith kinds, the assembly.* ones among them, and parts.catalog, a catalogue part by its entry and parameters.
Not in this wrapper yet.
Document.load_parts
A bench document that save wrote as text (the robot bench's file), opened with the parts.* kinds. A file that is not a document returns null, false or an empty value (the reason in Cadaclysm.last_error()) saying so.
Not in this wrapper yet.
Document.parts_kinds
Every node kind a bench document knows, the blacksmith's and the parts.* ones, as kinds lists them. Needs no document.
Not in this wrapper yet.
Document.export_ifc
The building as IFC text, IFC4 or IFC2x3, its geometry parametric (the design intent: extruded outlines, openings voiding their walls) or exact (the evaluated bodies, openings already cut); with a path, also written to that file. The time stamp defaults to now. A document that cannot be written in full returns null, false or an empty value (the reason in Cadaclysm.last_error()) with every reason at once, one a line, each on its node, and nothing is written.
Not in this wrapper yet.
Document.sheet_svg
A sheet (a bim.sheet node, by id) as SVG text sized in paper millimetres — its frame, title block, and the plans, sections, elevations, schedules and 3D views placed on it (a 3D view is drawn as its visible lines; a picture-style one, which only the web editor renders, as a box reading "3D view not rendered") — evaluating the document first; with a path, also written to that file. A node that is not a sheet returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Not in this wrapper yet.
Document.sheet_pdf
A sheet (a bim.sheet node, by id) as a one-page PDF the size of its paper, with a bookmark naming it — its frame, title block, and the plans, sections, elevations, schedules and 3D views placed on it (a 3D view is drawn as its visible lines; a picture-style one, which only the web editor renders, as a box reading "3D view not rendered") — evaluating the document first; with a path, also written to that file. A node that is not a sheet returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Not in this wrapper yet.
Document.sheets_pdf
Several sheets (ids) as one PDF: a page each in the order given, each its paper's size, a bookmark a page, a 3D view drawn as its visible lines (a picture-style one, which only the web editor renders, as a box reading "3D view not rendered"); with a path, also written to that file. An empty list, or a node that is not a sheet, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Not in this wrapper yet.
Document.save
The document as JSON text; with a path, also written to that file.
Not in this wrapper yet.
Document.apply
Applies one op, given as a JSON record or its text ({"op": "add", "node": {...}}, set, remove, rename, param), and records it as one commit with an optional message. Answers the changed set: the ids added, changed and removed, and the parameter names touched.
Not in this wrapper yet.
Document.add
A new node of a kind with its fields, one commit. Its id is made up unless the call gives one; the id is returned.
Not in this wrapper yet.
Document.add_solid
A node holding a solid the caller already has — made in code or read from a file — for other nodes to read like any built one: a solid.body node (a sheet.body one for a sheet) carrying the kernel's own B-rep (CadaclysmSolid.document_body), in the document's units, inside the saved file, which gives back exactly that body. Edges and faces are referenced on it as on any node, and replacing its body later finds them again by geometry. Its colours are kept — the solid's, each face's and each edge's — its name is not. The new id is returned.
Not in this wrapper yet.
Document.add_profile
A profile.path node holding a CadaclysmProfile exactly (CadaclysmProfile.document_path: arcs and NURBS as they are, holes included, its colour kept), in the document's units. The new id is returned.
Not in this wrapper yet.
Document.remove
Removes a node. Refused while another node reads it, unless cascade takes those readers with it.
Not in this wrapper yet.
Document.params
The parameters, name to value (a number, or an "=expression"), as a mutable mapping. Assigning one is a param op, one commit; deleting one removes it.
Not in this wrapper yet.
Document.batch
Ops applied live inside the block are recorded as one commit with the block's message. An error inside rolls every op of the batch back and is passed on.
Not in this wrapper yet.
Document.preview
Ops applied inside the block evaluate but are never recorded, and are taken back on leaving, normally or by an error: a drag, a what-if.
Not in this wrapper yet.
Document.undo
Takes back the head commit. False when there was nothing to take back.
Not in this wrapper yet.
Document.redo
Puts back the commit undo took back. False when there was nothing to put back.
Not in this wrapper yet.
Document.branch
The current branch's name, or none when the head is detached (switched to a commit id).
Not in this wrapper yet.
Document.branch_new
A new branch. Without a commit id it starts at the head and the document switches onto it; with one it starts there.
Not in this wrapper yet.
Document.switch
Moves the head to the branch of that name, else to the commit of that id, which detaches the head. The nodes follow.
Not in this wrapper yet.
Document.branch_rename
Renames a branch; refused when the old name is missing or the new one is taken.
Not in this wrapper yet.
Document.branch_delete
Deletes a branch; the current branch is refused. Its commits stay, as tips.
Not in this wrapper yet.
Document.tips
The tips of the lines no branch names — what an undo followed by an edit leaves behind — each as a whole Commit.
Not in this wrapper yet.
Document.log
The commits of a branch's line, newest first, the root c0 last; with no branch, the line from the head back to the root.
Not in this wrapper yet.
Document.evaluate
Evaluates the nodes that are stale (only the cheap kinds when asked) and answers the status of every node: ok, error, blocked or pending.
Not in this wrapper yet.
Document.evaluate_with
evaluate, with every kernel call's progress heard by a callback as (node, phase, done, total): node the id of the node being built, phase a short name, done of total steps within it. Every heavy node reports start before it runs, so a progress bar knows what is building and a host that crashes knows which node to leave out next time. The statuses are the same as evaluate's; a cheap-only pass reports nothing. The callback runs on the calling thread, often, and must not touch the document.
Not in this wrapper yet.
Document.errors
The nodes the evaluation left in error or blocked, each with its message.
Not in this wrapper yet.
Document.value
A node's value: a number, a point or list, a record, or text. returns null, false or an empty value (the reason in Cadaclysm.last_error()) for a node with none (missing, or in error).
Not in this wrapper yet.
Document.result
What a node evaluated to, by its kind: a CadaclysmSolid (solids and sheets), a CadaclysmProfile, a list of profiles, a CadaclysmNurbsCurve, a Subd, a list of these for a node run over a list (each item also read as id#i), or the value of a number, point, record, list and the like; none for no such node or one that failed. Each handle is the caller's own and outlives later edits.
Not in this wrapper yet.
Document.result_garment
Node id's value as a Garment: a garment.garment node, or any node that evaluates to one. Its lengths are in the document's units (convert a non-millimetre garment to millimetres before Garment.to_aama). A missing node, one that failed or one of another kind returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Not in this wrapper yet.
Document.revision
A counter that moves once with every change to the document's state — an apply, an undo or redo, a branch made, switched to or deleted, a preview frame, a batch's end — and never with an evaluation, a save or a read. A new or loaded document starts at 1. A page keys what it read on it and asks again only when it moved.
Not in this wrapper yet.
Document.nodes
The nodes as the file holds them, all of them in document order or those a list of ids names, in that order; an open batch's or preview's edits are in it. An unknown id returns null, false or an empty value (the reason in Cadaclysm.last_error()), naming it.
Not in this wrapper yet.
Document.inputs
The ids of the nodes a node reads, in document order: those its fields name, or with transitive everything those read too, however far, each once. Parameters are walked through, not listed. An unknown id returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Not in this wrapper yet.
Document.readers
The mirror of Document.inputs: the ids of the nodes that read a node, directly or with transitive however far — what removing it would break.
Not in this wrapper yet.
Document.probe
An op tried on a scratch copy: only the nodes ids names and what they read are evaluated, and their statuses answered. Until the probe ends, those nodes' results are the probe's and every other node's the document's; the document's nodes, history and revision are untouched, and every call that would change it is refused. A snapping tool tries a placement this way. Refused while a batch, a preview or another probe is open, for an op the copy refuses, or for an unknown id.
Not in this wrapper yet.
Document.result_beziers
A curve node, a profile, a list of profiles or a sketch as rational cubic Béziers, sixteen numbers each — x y z w per control point, as CadaclysmProfile.beziers() gives them: a curve on its own frame, a profile on the sketch plane, or either carried onto frame. An open probe's value is read for a node it evaluated. A node with none — a solid, a value — returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Not in this wrapper yet.
Document.meta
An app's own data about the document — what the last meta op set for it: a camera, a grid, a selection — undone and saved with the rest, never read by evaluation. None when the app keeps none.
Not in this wrapper yet.
Document.close
Free this handle now. Leaving a with block or the garbage collector does the same.
Not in this wrapper yet.
Commit
One commit of a Document's history, as plain data: what Document.log, Document.tips and Document.head return.
Not in this wrapper yet.
SubdMesh
One level of a cage's smooth surface, as Subd.smooth_mesh returns it: positions and normals (limit positions and unit outward limit normals, three numbers a vertex), indices (three vertex ids a triangle) and triangle_face (the face of the full cage each triangle lies on; on a mirrored half, face f of the half is f and its reflection f + len(faces)). Copied out of the cage, so it outlives it; the arrays are writable. At the C ABI the same arrays are views into the cage's handle, good until that handle is freed.
Not in the Godot add-on: it has no SubD by design.
SubdMesh.positions
The limit positions, an (n, 3) float64 array.
Not in the Godot add-on: it has no SubD by design.
SubdMesh.normals
The unit outward limit normals, an (n, 3) float64 array matching positions.
Not in the Godot add-on: it has no SubD by design.
SubdMesh.indices
The triangles, an (m, 3) uint32 array of ids into positions.
Not in the Godot add-on: it has no SubD by design.
SubdMesh.triangle_face
The cage face each triangle lies on, an (m,) uint32 array: the full cage's numbering (see above for a mirrored half).
Not in the Godot add-on: it has no SubD by design.
SubdReport
What Subd.to_solid did and how close it came, as plain data: how many patches were built exactly from their own net (regular) and how many from a refined neighbourhood (refined), the Catmull-Clark steps taken first, the deepest local refinement a patch needed (levels), and the two figures the options bound — the largest deviation from the limit surface and the largest tangent break g1_angle_deg across a side that is not creased — with the world points they were measured at.
Not in the Godot add-on: it has no SubD by design.
SubdReport.regular
Patches built exactly from their own net, with no refinement.
Not in the Godot add-on: it has no SubD by design.
SubdReport.refined
Patches built from a refined neighbourhood.
Not in the Godot add-on: it has no SubD by design.
SubdReport.steps
The Catmull-Clark steps taken before the patches were cut: 1 or 2.
Not in the Godot add-on: it has no SubD by design.
SubdReport.levels
The deepest local refinement a patch took; 0 when none was refined.
Not in the Godot add-on: it has no SubD by design.
SubdReport.deviation
The largest deviation from the limit surface, as a fraction of the cage's bounding-box diagonal.
Not in the Godot add-on: it has no SubD by design.
SubdReport.g1_angle_deg
The largest tangent break across a side that is not creased, in degrees.
Not in the Godot add-on: it has no SubD by design.
SubdReport.deviation_at
The world point deviation was measured at, three numbers.
Not in the Godot add-on: it has no SubD by design.
SubdReport.g1_at
The world point g1_angle_deg was measured at, three numbers.
Not in the Godot add-on: it has no SubD by design.
Subd
A Catmull-Clark control cage: positions, faces, creased edges, pinned vertices, an optional mirror plane, and the selection of the edit that made it. It is immutable — every edit returns a new Subd, whose selection names what that edit touched — and Subd.to_solid turns it into an exact B-rep that every CadaclysmSolid call takes. Close it when done, or let the language's scope do it; see Lifetimes. A refusal returns null, false or an empty value (the reason in Cadaclysm.last_error()) with the kernel's own words.
What the conversion to a solid does and does not do: it cuts one NURBS face per quad after one Catmull-Clark step, or two when a quad of the first step has two extraordinary corners (every cylinder primitive; SubdReport.steps says which) — so a cage quad gives 4 faces after one step, an n-gon n, and the 6-sided plain cylinder gives 144 — with a tangent-continuous block at each extraordinary vertex. A smooth vertex of high valence (7 or more on these primitives) may be refused at the default tolerances, with the measured figures: a plain 7-sided cylinder is, while an 8-sided one with creased rims converts. A crease or boundary side with 4 or more faces on one side has no tangent plane there, so a conversion through one may be refused. Fillets along edges that are splines are not available yet. At the C ABI, the arrays Subd.positions and Subd.smooth_mesh give are views into the cage's handle, good until that handle is freed.
Not in the Godot add-on: it has no SubD by design.
Subd.close
Free this handle now. The garbage collector, or the language's scope, does it otherwise.
Not in the Godot add-on: it has no SubD by design.
Subd.cuboid
A box of size (x, y, z), centred on the origin, with segments quads along each axis (1 to 1024 each). Default: a 2 x 2 x 2 box of one quad a side.
Not in the Godot add-on: it has no SubD by design.
Subd.cylinder
A cylinder along +Z: one n-gon cap per end with sides sides and rings bands of quads between them. With creased_rims (the default in Python) the two rim loops are creased, so the caps stay flat; an uncreased cylinder of 7 or more sides is refused by Subd.to_solid at the default tolerances.
Not in the Godot add-on: it has no SubD by design.
Subd.sphere
A quad ball of radius: a cube grid with segments quads per edge (at most 1024), each vertex pushed out to the radius.
Not in the Godot add-on: it has no SubD by design.
Subd.torus
A torus around +Z, all quads: around steps about the axis at radius major, tube steps round the tube of radius minor.
Not in the Godot add-on: it has no SubD by design.
Subd.from_parts
A cage from its parts, the lossless inverse of reading them back: positions (n, 3), faces lists of vertex ids, creases (a, b) pairs that are edges, pins vertex ids, and symmetry null or an axis ("x", "y" or "z") with a tolerance, for a mirrored half, as Subd.symmetry reports it. The new cage selects nothing. A malformed cage returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Not in the Godot add-on: it has no SubD by design.
Subd.positions
The cage's vertices, an (n, 3) float64 array of your own: a copy.
Not in the Godot add-on: it has no SubD by design.
Subd.faces
Each face's vertex ids, in loop order.
Not in the Godot add-on: it has no SubD by design.
Subd.creases
The creased edges, each as (smaller id, larger id), sorted.
Not in the Godot add-on: it has no SubD by design.
Subd.pins
The pinned vertices: they refine as corners and stay put.
Not in the Godot add-on: it has no SubD by design.
Subd.symmetry
null for an ordinary cage; for a mirrored half, the plane's axis ("x", "y" or "z") and how far from it a vertex counts as on it.
Not in the Godot add-on: it has no SubD by design.
Subd.selection
What the edit that made this cage touched: "vertices" or "faces" with ids, or "edges" with (a, b) pairs; null for a cage no edit selected (a primitive, Subd.from_parts, the mirror calls).
Not in the Godot add-on: it has no SubD by design.
Subd.transform
A new cage with the selected elements moved by matrix, and the same elements selected. selection is "vertices", "edges" or "faces" with ids (edges as (a, b) pairs); matrix is sixteen numbers column-major. A rotation about a point is baked into the matrix by the caller.
Not in the Godot add-on: it has no SubD by design.
Subd.crease
A new cage with edges ((a, b) pairs) creased, or un-creased when on is false; it selects them. A pair that is not an edge returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Not in the Godot add-on: it has no SubD by design.
Subd.pin
A new cage with vertices pinned (they refine as corners and stay put), or released when on is false; it selects them.
Not in the Godot add-on: it has no SubD by design.
Subd.extrude
A new cage with faces pushed out by distance along each connected region's average normal, with a quad wall on each boundary edge. The moved faces keep their ids and the new cage selects them.
Not in the Godot add-on: it has no SubD by design.
Subd.inset
A new cage with faces shrunk by amount, in (0, 1), within their surface, and a ring of quads round each region (round each face, with individual). The new cage selects the inner faces.
Not in the Godot add-on: it has no SubD by design.
Subd.subdivide
A new cage with faces subdivided once by the Catmull-Clark rules (the whole cage when no faces are given): each face becomes quads round a new point, and an unpicked face beside them takes the new edge points as corners. The whole cage keeps its smooth surface exactly. The new cage selects the new faces.
Not in the Godot add-on: it has no SubD by design.
Subd.insert_loop
A new cage with a loop of edges cut across the ring of quads through edge (an (a, b) pair), at a + at * (b - a) with at in (0, 1). It selects the new loop.
Not in the Godot add-on: it has no SubD by design.
Subd.edge_loop
The loop of edges through edge, straight across each valence-four vertex, the picked edge first and each pair smaller id first; empty when edge is not an edge of the cage.
Not in the Godot add-on: it has no SubD by design.
Subd.mirror_on
The positive half of the cage across the plane perpendicular to axis ("x", "y" or "z"), as a mirrored cage: every later edit keeps it symmetric.
Not in the Godot add-on: it has no SubD by design.
Subd.mirror_off
The mirror baked: the whole cage as an ordinary one, no longer mirrored.
Not in the Godot add-on: it has no SubD by design.
Subd.full
The whole cage of a mirrored half — the half's vertices first, then the reflections of those off the plane — or a copy of an ordinary cage.
Not in the Godot add-on: it has no SubD by design.
Subd.smooth_mesh
The smooth surface refined levels times (1 to 6, 3 by default), as a SubdMesh.
Not in the Godot add-on: it has no SubD by design.
Subd.pick
The cage element of kind ("vertex", "edge" or "face") under point, a point on or near the smooth surface: a vertex or face id, or an edge as (a, b) with the smaller id first. null when nothing is within 0.05 of the cage's diagonal — not an error. A point that is not finite returns null, false or an empty value (the reason in Cadaclysm.last_error()), which is not the same answer as nothing near.
Not in the Godot add-on: it has no SubD by design.
Subd.to_solid
The cage as an exact CadaclysmSolid, one NURBS face per patch (see above), and a SubdReport of what the conversion did. tolerance is the largest deviation from the limit surface as a fraction of the cage's diagonal (1e-4 by default), g1_angle the largest tangent break across an uncreased side in degrees (0.1), max_levels the deepest local refinement (2 to 6, 6). A tolerance or g1_angle of 0 or less, or a max_levels of 0, takes the default; any other max_levels outside 2 to 6 returns null, false or an empty value (the reason in Cadaclysm.last_error()). A cage that cannot be held within them returns null, false or an empty value (the reason in Cadaclysm.last_error()), with the figures it measured.
Not in the Godot add-on: it has no SubD by design.
CadaclysmHit
class CadaclysmHit extends RefCounted
One place two curves meet, as plain data, copied out: what CadaclysmProfile.hits() lists. A point has run false and start equal to end; a run has the two curves coinciding from start to end. A point at the join of two segments is reported once, on either: as segment k at t 1 or as segment k + 1 at t 0.
CadaclysmHit.run
var run: bool # read-only
Whether the curves coincide along a stretch rather than meeting at a point.
CadaclysmHit.touch
var touch: bool # read-only
For a point: the curves are tangent there rather than crossing. Where a side ends there, true if the two continue each other smoothly; an end resting on the other at an angle, or a corner, is not a touch.
CadaclysmHit.start
var start: Vector3 # read-only
Where it starts, three numbers (z is 0 for two profiles).
A Vector3, of floats; raw_start keeps the doubles.
CadaclysmHit.end
var end: Vector3 # read-only
Where it ends: start again for a point.
A Vector3, of floats; raw_end keeps the doubles.
CadaclysmHit.a_start
var a_start: CadaclysmSpot # read-only
Where it starts on the first curve, as a CadaclysmSpot.
raw_start and raw_end Godot only
var raw_start: PackedFloat64Array # read-only
var raw_end: PackedFloat64Array # read-only
CadaclysmHit.start and CadaclysmHit.end as three doubles each, where start and end hold Vector3s of floats.
CadaclysmSpot
class CadaclysmSpot extends RefCounted
Where a CadaclysmHit lands on one side: a profile's loop, segment and position along it, or (from later calls) a solid's face and its surface parameters.
CadaclysmSpot.loop_index
var loop_index: int # read-only
The loop: 0 the boundary or the open chain, then the holes in the order they were added. NONE on a face.
CadaclysmSpot.segment
var segment: int # read-only
The segment of that loop, in drawing order. NONE on a face.
CadaclysmSpot.t
var t: float # read-only
How far along the segment, 0 at its start to 1 at its end: by length on a line, by angle on an arc, by parameter on a spline.
CadaclysmSolidHits
class CadaclysmSolidHits extends RefCounted
What CadaclysmSolid.hits() found, copied out: hits, every place profile pierces or grazes this solid's faces, as CadaclysmHit values (a the profile, b the face: face, u, v), ordered along the profile; pieces, the profile's loops cut at the hits, as CadaclysmPiece values — empty unless the solid is closed.
CadaclysmSolidHits.hits
var hits: Array[CadaclysmHit] # read-only
Every place profile meets a face, as CadaclysmHit values.
CadaclysmSolidHits.pieces
var pieces: Array[CadaclysmPiece] # read-only
The profile's loops cut at the hits, as CadaclysmPiece values; empty for an open solid.
CadaclysmPiece
class CadaclysmPiece extends RefCounted
One stretch of CadaclysmSolid.hits()'s profile between two cuts, as plain data: one of CadaclysmSolidHits.pieces. A piece's spots follow the cut, not the hit that made it: a segment join reads as the next segment's start (k + 1, 0), not the hit's (k, 1), and a closed loop's closing join stays (0, 0); an open chain's end reads (n - 1, 1). A loop no hit cuts is one piece, geometrically closed, start and end both (0, 0).
CadaclysmPiece.inside
var inside: bool # read-only
Whether the piece is inside the solid, by its middle's winding number over the solid's mesh — a piece lying on the surface (a run, or a midpoint within tolerance of a face and inside it) counts as inside too, with no third state.
CadaclysmPiece.start
var start: CadaclysmSpot # read-only
Where the piece starts, as a CadaclysmSpot.
CadaclysmPiece.profile
var profile: CadaclysmProfile # read-only
The piece on its own, as an open CadaclysmProfile — unless the piece is a whole uncut loop, which comes back closed.
Manifold
What CadaclysmSolid.manifold returns: whether the solid's faces make a manifold, and whether it is closed, told from its topology rather than a mesh.
No class: a Dictionary with these keys.
Manifold.boundary_edges
Edges only one face borders: a sheet's rim, a hole in a shell.
The boundary_edges key.
Manifold.non_manifold_edges
Edges three or more faces border: a fin, or two solids meeting along a line.
The non_manifold_edges key.
Manifold.non_manifold_vertices
Vertices whose faces make more than one fan: two solids touching at a corner.
The non_manifold_vertices key.
Manifold.is_manifold
No non-manifold edge or vertex: a manifold, possibly with a boundary.
The is_manifold key.
CadaclysmSolidFemMesh
class CadaclysmSolidFemMesh extends RefCounted
One solid meshed for a solver: nodes welded by bits, triangles wound outward, every node tagged with the lowest-dimension B-rep entity it lies on, and every crack reported rather than closed. What CadaclysmSolid.fem_mesh() returns, and owned by you: free it, or let the language's scope do it (see Lifetimes).
A handle rather than a snapshot, as a CadaclysmSolid is. In every wrapper that can lend a view, the big arrays are read-only views into the library's own memory, as CadaclysmSolid.mesh()'s are — a solver mesh is megabytes. Node and Godot copy instead, having no borrowed-view machinery at all, so for those two the array is theirs and everything below about a stale view falls away. Either way the owner of the memory is this object rather than the solid: CadaclysmSolid.close() does not free a FEM mesh, and meshing the solid again at another tolerance does not touch it either — a FEM mesh and a held tessellation (CadaclysmSolid.mesh()'s own) are each their own handle, neither one the solid's cache that a re-mesh replaces. Only CadaclysmSolidFemMesh.release() does, or the language's own scope or collector reclaiming the handle.
So keep the FEM mesh itself reachable for as long as you read a view of it, and copy anything that must outlive it. What refuses a stale read is a different mechanism in each language, so all ten are named here rather than a rule with an "otherwise" in it. Swift's view type carries its owner and asks it before every element, so the read itself is refused — it traps inside the subscript getter, measured in a release build. Rust settles it before the program runs: its free takes the mesh by value, so a slice can neither be asked for after it nor held across it. Godot and Node hand back copies, so there is nothing of the library's left to go stale. Python, C#, Java and C++ check the handle in the accessor, so a view asked for after the free is refused and one already in hand is a bare array, span or buffer that reads freed memory — measured in C#, where a span taken before the free read the body's own coordinates out of the freed block. Python's numpy array does hold the mesh, which keeps it reachable (below), but nothing asks the mesh when the array is read, so one kept past an explicit free() dangles as C#'s span does. Go's and LuaJIT's arrays are fields filled when the mesh was built rather than accessors, so neither moment is refused there; their methods are, and for those two this is documented rather than enforced, as their own module headers already do for the scene.
Staying reachable is a second question, and a narrower one. In C#, Java, Go and LuaJIT the view is the platform's own array type with nowhere to hold a reference back to the handle, so a program that keeps a view and lets go of the mesh can have the collector free the handle under it with nothing ever calling CadaclysmSolidFemMesh.release() — measured in C#, Java and Go. C++ has no collector but the same shape at scope end: the mesh's destructor frees the handle when it goes out of scope, and a Span kept past that reads freed memory. A view type that carries its owner is safe from that (Python's, Swift's), and so is a language that rules the case out — Rust borrows the mesh for the view's lifetime, Godot and Node copy. The same rule as CadaclysmSolid.mesh()'s own views.
It is freed where a CadaclysmSolid is closed: the same word the reader library's FEM mesh uses, so one FEM mesh is released the same way on both sides of the ABI.
CadaclysmSolidFemMesh.nodes
var nodes: PackedFloat64Array # read-only
Every node's position, three doubles each: placed by CadaclysmSolid.fem_mesh()'s placement, in the solid's own coordinates otherwise.
Every array here is a copy, as CadaclysmSolid.mesh's are: Godot's packed arrays have nowhere to point into the library's memory, so the paragraph above does not apply to Godot — one already in hand survives release(), the collector and the owner, and nothing the solid does can stale it. The price runs the other way, every ask copying again, so read nodes into a variable rather than calling it inside a loop. They are flat doubles, three a node, in a PackedFloat64Array rather than a PackedVector3Array: what a solver wants is the f64 the kernel computed, and Godot's Vector3 holds floats — the same reason CadaclysmChain.raw_points and CadaclysmFrame.raw sit beside their Godot-typed twins.
CadaclysmSolidFemMesh.triangles
var triangles: PackedInt32Array # read-only
Three node indices a triangle, wound outward — a mirroring placement is wound back.
CadaclysmSolidFemMesh.triangle_face
var triangle_face: PackedInt32Array # read-only
Which face each triangle lies on, one per triangle: the same faces CadaclysmSolid.face_kind() names.
CadaclysmSolidFemMesh.node_kind
var node_kind: PackedInt32Array # read-only
What each node lies on — 0 a B-rep vertex, 1 an edge, 2 a face — one per node: the lowest-dimension entity it lies on, which is the .msh format's own classification rule. CadaclysmSolidFemMesh.node_entity says which entity of that kind.
CadaclysmSolidFemMesh.node_entity
var node_entity: PackedInt32Array # read-only
Which vertex, edge or face each node lies on, read by the matching CadaclysmSolidFemMesh.node_kind: an index into CadaclysmSolidFemMesh.vertices, into CadaclysmSolidFemMesh.edges, or into the solid's faces.
CadaclysmSolidFemMesh.face_count
var face_count: int # read-only
The solid's faces — the same faces CadaclysmSolid.faces counts.
CadaclysmSolidFemMesh.edges
var edges: Array[Dictionary] # read-only
One FemEdge per B-rep edge, in the order a CadaclysmSolidFemMesh.node_kind of 1 indexes them. Not CadaclysmSolid.edges' numbering: these are the manifold analysis's, ascending by edge id.
FemEdge.
One B-rep edge's chain of nodes, and where that chain breaks. nodes are this mesh's node indices in order along the edge, its end vertices included. runs says where the chain breaks: each entry is a start offset into nodes, and the nodes from one offset up to the next — the last offset running to the end — are a polyline of their own, with nothing joining across a boundary. The two ends either side of a boundary are two points of the edge with no mesh edge between them. (0,) is the ordinary answer, and a caller reading nodes as one polyline without looking here jumps the gap silently.
faces is (face_a, face_b) and ends is (end_a, end_b), the second of each a sentinel where there is none — an open sheet's rim, or both ends at one vertex. 0 is a real face and a real vertex, not a sentinel, and faces numbers the solid's faces as CadaclysmSolid.face_kind() does. closed where the nodes make one loop, never with more than one run; seam where one face bounds the edge twice, and both faces are then that same face.
id is the solid's own edge id, not this mesh's edge index: CadaclysmSolidFemMesh.edges is a densely renumbered subset of the solid's edges, with every edge collapsed to a point left out, so a sphere — whose two pole runs collapse — reports its seam as edge 0 with an id of 1. Everything else that names an edge means the index: a CadaclysmSolidFemMesh.node_kind of 1 read through CadaclysmSolidFemMesh.node_entity, the third number of a CadaclysmSolidFemMesh.open_edges or CadaclysmSolidFemMesh.folded_edges row, and the edge_<i> physical group of CadaclysmSolidFemMesh.msh_text(). It is not a row of CadaclysmSolid.edges either, that table being the solid's edges grouped by geometry; the id names the topological edge, which is what the .msh entities and the censuses speak in.
No class: each edge is a Dictionary — id (an int), nodes and runs (PackedInt32Arrays, counted from zero), faces and ends (PackedInt64Arrays of two, wide enough for the NONE sentinel 4294967295, which an int32 would come out as -1), and closed and seam (bools). There is no chains() helper here: walk the runs with nodes.slice(runs[i], runs[i + 1] if i + 1 < runs.size() else nodes.size()).
CadaclysmSolidFemMesh.vertices
var vertices: Array[Dictionary] # read-only
One FemVertex per B-rep vertex, in the order a CadaclysmSolidFemMesh.node_kind of 0 indexes them.
FemVertex.
One B-rep vertex: node is the mesh node there, a sentinel where the mesh has none, which is ordinary rather than a fault — the analysis rebuilds a vertex wherever two trims meet, so a sphere has 48 of them where the mesh has two points, and a caller walking these skips the sentinel instead of reading it as a gap.
point is where the topology says the vertex is, in the same space and under the same placement as CadaclysmSolidFemMesh.nodes. Meaningless unless has_position: it is all zeros then, a point no geometry has and one a solver would read as a node at the origin.
No class: each vertex is a Dictionary — node (an int, the NONE sentinel 4294967295 where the mesh has none there), point (a PackedFloat64Array of three, in the same space as nodes and doubles for the same reason) and has_position (a bool).
CadaclysmSolidFemMesh.open_edges
var open_edges: Array[PackedInt64Array] # read-only
Every crack, as (a, b, brep_edge): a directed mesh edge (a, b) with no (b, a), and the B-rep edge both nodes lie on where they share one.
Empty unless the solid's topology is closed, whose mesh is otherwise not asked about at all: an open sheet from CadaclysmSolid.face(), CadaclysmSolid.face_sheet(), CadaclysmSolid.drop_faces() or CadaclysmSolid.extrude_open() makes no claim to enclose anything, so its rim is not a crack. Such a solid reports CadaclysmSolidFemMesh.watertight false with this and CadaclysmSolidFemMesh.folded_edges both empty, and that trio of answers together is what says "not asked", not "nothing found".
That rule holds here without exception, where the reader library has one: every solid has a B-rep behind it, so this library has no mesh-only body whose census speaks from the triangles alone. See CadaclysmSolidFemMesh.from_mesh.
Each row is a PackedInt64Array of three, [a, b, brep_edge]. Int64 rather than Int32 because the NONE sentinel (4294967295) does not fit an int32, where it would come out as -1 — as an edge's faces and ends do not either.
CadaclysmSolidFemMesh.folded_edges
var folded_edges: Array[PackedInt64Array] # read-only
Every fold, as CadaclysmSolidFemMesh.open_edges reports a crack: a directed mesh edge used by more than one triangle, once.
A solid can be folded without being open — one no thicker than a line leaves no hole for an open edge to find — and the closure census's own known-bad bodies are folds rather than open cracks. A caller that checks CadaclysmSolidFemMesh.open_edges alone calls such a solid sound. Empty under the same rule as CadaclysmSolidFemMesh.open_edges.
CadaclysmSolidFemMesh.crossings
var crossings: Array[PackedInt64Array] # read-only
Every pair of triangles that pass through each other, as (a, b) with a < b, sorted: an edge of one through the other's interior. Their B-rep faces are CadaclysmSolidFemMesh.triangle_face at a and b.
Computed for every solid, open or closed. CadaclysmSolidFemMesh.watertight, CadaclysmSolidFemMesh.open_edges and CadaclysmSolidFemMesh.folded_edges are topological and cannot see a surface passing through itself; a mesh is ready for a volume mesher when it is CadaclysmSolidFemMesh.watertight and this is empty — Gmsh refuses one that crosses. A copy.
CadaclysmSolidFemMesh.watertight
var watertight: bool # read-only
The topology is closed and the welded mesh is too — every directed mesh edge paired with its reverse and none used twice. false for every solid whose topology is not closed; read CadaclysmSolidFemMesh.open_edges for what an empty census beside a false here does and does not mean.
Ready for a volume mesher means this and an empty CadaclysmSolidFemMesh.crossings: this census is topological and cannot see a surface passing through itself.
CadaclysmSolidFemMesh.from_mesh
var from_mesh: bool # read-only
Always false here, and kept so the two ABIs hand back one struct: a CadaclysmSolid always has a B-rep, so this library has no mesh-only body to report.
The reader's CadaclysmNode.fem_mesh() sets it for a node with no B-rep, where it also says which space the mesh is in — here there is only one space, the solid's own under the placement — and where a true means the crack census spoke from the triangles alone rather than from a topology. That second difference cannot arise on this side.
CadaclysmSolidFemMesh.min_angle
var min_angle: float # read-only
The smallest interior angle of any triangle, in degrees. There is always one: a solid that meshed to no triangles is a refusal, not a mesh.
CadaclysmSolidFemMesh.worst_triangle
var worst_triangle: int # read-only
The triangle with that angle, as an index into CadaclysmSolidFemMesh.triangles.
CadaclysmSolidFemMesh.longest_edge
var longest_edge: float # read-only
The longest triangle edge, placed. The figure to check against CadaclysmSolid.fem_mesh()'s max_size, and the only one that says what the mesh actually is. max_size bounds the boundary segments and merely targets the interior: measured at 1.03 x max_size on a face whose parameters run unevenly, where a full-size boundary piece met a much shorter one left by halving. One small enough beside the solid to reach the mesher's own piece and station ceilings is not honoured at all.
CadaclysmSolidFemMesh.msh_text()
func msh_text() -> String
The mesh as Gmsh 4.1 ASCII .msh text: an entity per B-rep vertex, edge and face, a volume where the solid closes, and a physical group naming each.
Gmsh reads the file as written — measured with Gmsh 4.15: node and triangle counts equal to this mesh's, and a physical group per entity. To fill a closed solid with tetrahedra, give Gmsh a volume of its own over the file's surfaces. In its Python API: gmsh.open(path), then faces = [t for _, t in gmsh.model.getBoundary([(3, 1)], oriented=False)], gmsh.model.geo.addVolume([gmsh.model.geo.addSurfaceLoop(faces)]), gmsh.model.geo.synchronize() and gmsh.model.mesh.generate(3). A plain generate(3) leaves a volume read from any .msh file empty — Gmsh's own saved meshes too — and gmsh.model.mesh.createGeometry() re-meshes the surfaces rather than keeping these triangles.
Prefer Gmsh's HXT algorithm: gmsh.option.setNumber("Mesh.Algorithm3D", 10) before generate(3). On these surfaces the default left tetrahedra of exactly zero volume (four in a 100 mm bar), which no solver can use, and HXT's worst element came out far better on curved bodies (a minimum SICN of 0.1 to 0.3 where the default's was 0.001). Then name the tetrahedra before saving: HXT fills the new volume rather than the file's own, and gmsh.write keeps only elements in a physical group, so without this step every tetrahedron is dropped from the file without a word — filled = [t for _, t in gmsh.model.getEntities(3) if len(gmsh.model.mesh.getElementsByType(4, t)[0])], gmsh.model.removePhysicalGroups(gmsh.model.getPhysicalGroups(3)) and gmsh.model.addPhysicalGroup(3, filled, name="body"). The saved file also lists a few interior nodes no element uses — points Gmsh's refinement tried and gave up on — so a solver reading it should keep only the tetrahedra's own nodes: each unused one is an unconstrained unknown.
On this side of the ABI the library's text is owned and handed over, released by the wrapper (cadaclysm_blacksmith_string_free at the ABI) as every other text this library writes — CadaclysmSolid.step_text(), CadaclysmSolid.sat_text(), CadaclysmSolid.brep_text(). Two asks give two independent texts, and neither dies with the handle. The reader library's own msh_text is the other way round: it borrows a slot on its handle, replaced by the next call and gone with the mesh. A reader porting one side's reasoning onto the other leaks or double-frees.
The unlicensed notice is printed here, on this writer and on CadaclysmSolidFemMesh.save_msh(), and not by CadaclysmSolid.fem_mesh(): meshing is not a licensed output and the .msh file is, which is where CadaclysmSolid.sat_text() and CadaclysmSolid.brep_text() put theirs too. The reader library notices in its constructor instead and on neither .msh call; each matches its own siblings, so moving the call to look like the other side breaks a convention.
It returns null, false or an empty value (the reason in Cadaclysm.last_error()) for a mesh the writer refuses, naming the field it cannot honour, and for a freed handle.
CadaclysmSolidFemMesh.save_msh()
func save_msh(path: String) -> bool
CadaclysmSolidFemMesh.msh_text() written to a path, replacing any file there. It returns null, false or an empty value (the reason in Cadaclysm.last_error()) for a mesh the writer refuses or a file it cannot write, naming the path. Prints the unlicensed notice; see CadaclysmSolidFemMesh.msh_text().
CadaclysmSolidFemMesh.release()
func release() -> void
Give the mesh back, and with it every view taken from it. Idempotent; the collector or the scope does it otherwise.
Spelled release(), as CadaclysmBrep.release is, and not free(): Godot gives every Object a free() of its own, which deletes the object and is an error on a RefCounted — which every class here is. Nor could this be spelled free anyway: measured, Object.call intercepts that name before the class's own methods are looked at, so a free() registered here is never reached and the handle stays alive. There are no views to give back with it, every array this class hands out being a copy, so what it ends is the handle and the calls that read through it — each of which then leaves the FEM mesh was released in Cadaclysm.last_error(). CadaclysmSolidFemMesh.released says whether it has run; a second call is a no-op, and letting the last reference go does it too.
CadaclysmTool
class CadaclysmTool extends RefCounted
A cutter: Grbl tool number (1 to 255, the T word), diameter and flute_length in mm, feed and plunge in mm/min, rpm its spindle speed, ramping into its cuts at ramp_angle degrees. Immutable; a job keeps its own copy.
CadaclysmTool.flat()
static func flat(number: int, diameter: float, flute_length: float, feed: float, plunge: float, rpm: float, ramp_angle: float = 3.0) -> CadaclysmTool
A flat end mill. A number outside 1..255, a size, feed or speed not positive and finite, or a ramp_angle outside (0, 90], returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmTool.ball()
static func ball(number: int, diameter: float, flute_length: float, feed: float, plunge: float, rpm: float, ramp_angle: float = 3.0) -> CadaclysmTool
A ball end mill, as flat but its tip a half sphere of the diameter; in 2.5D it cuts where a flat does, bottom being the tip.
CadaclysmTool.drill()
static func drill(number: int, diameter: float, flute_length: float, feed: float, rpm: float) -> CadaclysmTool
A drill, plunging at feed. A job takes it for CadaclysmJob.drill() only.
CadaclysmTool.shape
The cutting end: "flat", "ball", "drill", "vbit" or "bullnose" — spelled as a machining view's tool description spells it.
Not in this wrapper yet.
CadaclysmTool.flute_length
How far up the cutting edge reaches from the tip, in mm.
Not in this wrapper yet.
CadaclysmTool.angle
A V-bit's included angle, in degrees; null for every other shape.
Not in this wrapper yet.
CadaclysmTool.corner_radius
A bull-nose's corner radius, in mm; null for every other shape.
Not in this wrapper yet.
with_ramp_angle Godot only
func with_ramp_angle(degrees: float) -> CadaclysmTool
A new tool, this one ramping into its cuts at degrees instead. Python has no such method: it sets the ramp when the tool is made, and flat and ball here do the same — their ramp_angle defaults to 3.0, the library's own. This is the Rust SDK's Tool::with_ramp_angle passed through, so a tool already in hand can be re-ramped without repeating its other arguments. Fails for an angle outside (0, 90].
CadaclysmStock
class CadaclysmStock extends RefCounted
The block of material a job cuts, an axis-aligned box. Immutable; a job keeps its own copy.
CadaclysmStock.box_()
static func box_(min: Variant, max: Variant) -> CadaclysmStock
The box from min (x, y, z) to max. Unless every min is below its max and all six are finite, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmStock.around()
static func around(solid: CadaclysmSolid, margin: float = 0.0) -> CadaclysmStock
solid's bounds grown by margin in -X, +X, -Y, +Y and +Z; the bottom stays at the solid's lowest Z. A margin negative or not finite returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmProgram
class CadaclysmProgram extends RefCounted
One file a job wrote: a Grbl program (tool its T number, name <job name>-T<n>, or <job name>-<k>-T<n> for a repeated tool) or, from CadaclysmJob.write_camotics(), a simulation copy or the CAMotics project (tool 0). Read-only.
CadaclysmProgram.tool
var tool: int # read-only
The program's Grbl T number, or 0 for a CAMotics project file.
CadaclysmProgram.name
var name: String # read-only
The program's name without extension (<name>-T<n>, or <name>-<k>-T<n> for a repeated tool) from CadaclysmJob.gcode(); the file name from CadaclysmJob.write_camotics().
CadaclysmJob
class CadaclysmJob extends RefCounted
A machining job on a CadaclysmStock: operations kept in the order they are added, written as one Grbl 1.1 program per run of operations sharing a tool. Mutable — each operation is added in place, and a refused one leaves the job as it was. safe_z is the absolute Z of rapids between operations and at a program's start and end, above the stock's top; an operation enters and leaves its passes clearance above its top; tolerance fits free-form sides and offsets; name names the programs (<name>-T<n>); every program waits spindle_dwell seconds after starting the spindle; resolution is the CAMotics project's voxel size in mm. A safe_z not above the stock, or a setting the job refuses, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmJob.face()
func face(tool: CadaclysmTool, z: float, stepover: float, stepdown: float) -> bool
Face the stock's top down to z, in zigzag rows along X stepover apart and passes at most stepdown deep. A drill, a z above the stock's top, a stepover past the tool's diameter, or what the job otherwise refuses, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmJob.contour()
func contour(tool: CadaclysmTool, profile: CadaclysmProfile, top: float, bottom: float, side: String = "outside", stepdown: float = 1.0, climb: bool = true, open: bool = false) -> bool
Cut along profile from top to bottom in passes at most stepdown deep: side "outside" the profile, "inside" it, or "on" its line; climb for climb milling, else conventional; open to cut the outline as an open chain (only "on" its line, and with no holes). Any other side raises ValueError; what the job otherwise refuses, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmJob.pocket()
func pocket(tool: CadaclysmTool, profile: CadaclysmProfile, top: float, bottom: float, stepover: float, stepdown: float) -> bool
Clear profile — its holes left standing as islands — from top to bottom, in rings stepover apart (at most the tool's radius) and passes at most stepdown deep. What the job refuses returns null, false or an empty value (the reason in Cadaclysm.last_error()); a pocket too small for the tool is refused by CadaclysmJob.gcode(), naming the operation.
CadaclysmJob.drill()
func drill(tool: CadaclysmTool, points: Variant, top: float, bottom: float, peck: float = f64.NAN) -> bool
Drill a hole at each (x, y) of points from top to bottom, pecking peck deep at a time (retracting between pecks), or straight to depth for none. A point that is not two numbers raises ValueError; a tool that is not a drill, no points, or what the job otherwise refuses, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmJob.gcode()
func gcode() -> Array[CadaclysmProgram]
The job as Grbl 1.1 programs, one per run of consecutive operations sharing a tool (T1, T2, T1 gives three), each named <name>-T<n> (or <name>-<k>-T<n> for run k of a tool that runs more than once); an empty list for a job with no operations. An operation whose geometry the tool cannot cut (named by its index and kind) returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmJob.write_camotics()
func write_camotics(path: String) -> PackedStringArray
A CAMotics project at path and its files beside it, named after the project's file stem (out/part.camotics writes out/part-T1.nc), not the job's name: each program, a simulation copy of it (.sim.nc, which the project lists), and the project last. Creates the directory. Returns the paths written, the project last. A path with no file stem, what CadaclysmJob.gcode() refuses, or a file that cannot be written, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmJob.machine()
func machine(part: CadaclysmSolid, end_mill: CadaclysmTool, stepover: float = f64.NAN, stepdown: float = f64.NAN, skin: float = 0.3, peck: float = f64.NAN) -> CadaclysmReport
Recognise part — a solid inside the job's stock — by Z-level sectioning, and append the operations that make it: one face (if the stock top is above the part's top), the pockets level by level from the top down, then one drill per drill tool and bottom. end_mill must be a flat or ball tool, not a drill; drills are tried against each hole found, the closest match within 0.05 mm winning. end_mill may also be a list of end mills, largest first: the first clears as above, and each later one cleans only what the earlier ones left — inside corners, regions too narrow for them, and holes no drill matches — with pockets of its own after the earlier tools' and before the drills. Each later tool's stepover and stepdown default to its own; one given applies to the first and is clamped to each later tool's radius and flutes. The report then lists only what no end mill reached; a corner, or a region too narrow, names the smallest end mill that tried. stepover defaults to 0.4 x diameter, stepdown to min(diameter / 2, flute_length) (null asks for the kernel's own default for either); skin (at least 0, default 0.3) is how far above the part's lowest point the outline stops, so the part stays attached to the stock — 0 cuts through; corner_relief (default off) relieves every inside corner the smallest end mill leaves with a dog-bone: the cutter runs on along the corner's bisector until its edge touches the corner, notching both walls by r (1 - sin(θ/2)) for a corner of angle θ — 0.293 mm for a 2 mm end mill at a right angle. Each comes back as a relief item in place of its corner item: the vertex, the notch depth as size, the tool and Z range in reason, the notch as its region. Narrow regions, undercuts, holes and slopes are never relieved. peck is passed to every drill operation (null for none). Returns a CadaclysmReport of what could not be cut — nothing that would gouge is ever emitted; a feature the tools can't make is machined as far as possible and reported instead. The job changes only on success: what the kernel otherwise refuses (a drill as end_mill, a drills entry that isn't a drill, a tool number clashing with one already in the job, part outside the stock, a skin negative or not less than the part's height, no level found, a stepover or stepdown out of range, an empty list of end mills, one not smaller than the one before it, two sharing a number) returns null, false or an empty value (the reason in Cadaclysm.last_error()) and leaves the job exactly as it was.
CadaclysmJob.operations()
func operations() -> Array[CadaclysmOperation]
Every operation added to this job so far, in order — whether by CadaclysmJob.face(), CadaclysmJob.contour(), CadaclysmJob.pocket(), CadaclysmJob.drill() or CadaclysmJob.machine() — as a list of CadaclysmOperation.
CadaclysmJob.show
Play the job on its stock with the GPU view library, in the one shared window, from its start at real time, and return at once. The window's keys drive it — space plays or pauses, left and right step a move, up and down multiply the speed by 4 or divide it, Home and End seek the start and the end, L loops — and its title is the status line (move 370 of 638 · T1 flat 6 mm · X12.3 Y-4.0 Z7.0). part, a CadaclysmSolid, colours the stock by deviation from it. The terminal library cannot cut a stock and refuses. In the notebook, draw with show(job, part).
Comes with the viewers follow-up.
CadaclysmJob.view
CadaclysmJob.show in a fresh window that blocks until it is closed; returns the camera and the last pick, as CadaclysmSolid.view does.
Comes with the viewers follow-up.
CadaclysmJob.stock
The stock's box as the job holds it, ((min_x, min_y, min_z), (max_x, max_y, max_z)) — what CadaclysmStock.box_() was given, or what CadaclysmStock.around() worked out.
Not in this wrapper yet.
CadaclysmJob.tools
The tools this job was given — by CadaclysmJob.face(), CadaclysmJob.contour(), CadaclysmJob.pocket(), CadaclysmJob.drill() and CadaclysmJob.machine() (the end mill and drills its operations use; it refuses two different tools offered under one number) — by Grbl number, so a CadaclysmProgram's tool finds its tool. A refused call adds none. A new mapping each time.
Not in this wrapper yet.
create Godot only
static func create(stock: CadaclysmStock, safe_z: float, clearance: float = 1.0, tolerance: float = 0.01, name: String = "job", spindle_dwell: float = 2.0, resolution: float = 0.1) -> CadaclysmJob
Python's Job(stock, safe_z, clearance=1.0, tolerance=0.01, name="job", spindle_dwell=2.0, resolution=0.1). (new is GDScript's own, as CadaclysmFrame.create is, so the constructor is create.)
close and closed Godot only
func close() -> void
var closed: bool # read-only
Godot's objects are not deterministically dropped, so, as CadaclysmSolid.close() and CadaclysmAssembly.close() do, a job takes an explicit close(): every call after fails with "job: closed" in Cadaclysm.last_error(). closed (as CadaclysmSolid.closed is) tells whether it has run.
machine, machine_with_drills and machine_with_end_mills Godot only
func machine(part: CadaclysmSolid, end_mill: CadaclysmTool, stepover: float = f64.NAN, stepdown: float = f64.NAN, skin: float = 0.3, peck: float = f64.NAN) -> CadaclysmReport
func machine_with_drills(part: CadaclysmSolid, end_mill: CadaclysmTool, drills: Array, stepover: float = f64.NAN, stepdown: float = f64.NAN, skin: float = 0.3, peck: float = f64.NAN) -> CadaclysmReport
func machine_with_end_mills(part: CadaclysmSolid, end_mills: Array, drills: Array, stepover: float = f64.NAN, stepdown: float = f64.NAN, skin: float = 0.3, peck: float = f64.NAN, corner_relief: bool = false) -> CadaclysmReport
CadaclysmJob.machine() split as GDScript has no null default for an array: machine(part, end_mill, ...) drills nothing, machine_with_drills(part, end_mill, drills, ...) takes the CadaclysmTool drills — the same two-call shape as CadaclysmScene.open/open_with — and machine_with_end_mills(part, end_mills, drills, ...) takes an array of CadaclysmTool end mills, at least one, in place of the one (drills may be []).
CadaclysmReport
class CadaclysmReport extends RefCounted
What CadaclysmJob.machine() could not make: a read-only sequence of CadaclysmReportItem, in the order found, read once when machine returns. len(report) counts the items, it iterates and indexes them, and str(report) is the kernel's own text — one line per item, or "nothing left uncut"; bool(report) is true when it has items.
Report fields Godot only
var items: Array[CadaclysmReportItem] # read-only
var text: String # read-only
var is_empty: bool # read-only
GDScript objects have no len/iteration/str/bool protocol to overload, so a report reads as three properties instead: items (a CadaclysmReportItem array, CadaclysmReport's own sequence), text (the kernel's own text, what to_string() on the report is too) and is_empty (whether items is empty — true for "nothing left uncut", Python's not bool(report)).
Report item
class CadaclysmReportItem extends RefCounted
One thing CadaclysmJob.machine() left uncut, one of CadaclysmReport's items. Read-only.
CadaclysmReportItem.kind
var kind: String # read-only
"corner" (material the end mill doesn't reach), "hole" (a round hole no drill matches or a matched drill can't make), "slope" (a face that is neither horizontal nor vertical, cut as steps), "undercut" (material under an overhang), "too_deep" (a level below the end mill's flute length, cut only that far) or "relief" (an inside corner cut beyond the part on purpose — a dog-bone, corner_relief).
CadaclysmReportItem.at
var at: Vector3 # read-only
The item's XYZ location — a centroid for an area, the axis point at the top for a hole.
CadaclysmReportItem.size
var size: float # read-only
An area in mm^2 for corner/undercut, a diameter in mm for hole, a height in mm (its Z range) for slope and too_deep, and the notch depth in mm for relief.
CadaclysmReportItem.reason
var reason: String # read-only
One sentence naming the cause and the tool involved.
CadaclysmReportItem.top
var top: float # read-only
The highest Z the item stands at: a corner's or undercut's band top, a hole's top, a slope's top, or for too_deep the flutes' reach.
CadaclysmReportItem.bottom
var bottom: float # read-only
The lowest Z the item stands down to: the floor a corner or undercut reaches, a hole's floor, a slope's foot, or for too_deep the level.
CadaclysmReportItem.region
var region: Array[CadaclysmProfile] # read-only
The XY area the item covers, as a list of CadaclysmProfile: a corner's or undercut's piece, a hole's disc, the area a slope's face covers, or for too_deep the reachable area cut short (the whole stock when it is the part's top).
CadaclysmOperation
class CadaclysmOperation extends RefCounted
One operation of a CadaclysmJob, read back by CadaclysmJob.operations(). Read-only.
CadaclysmOperation.params
var params: Dictionary # read-only
A dict of the operation's own arguments, in the kind-specific order it stores them — z, top, bottom, stepover, stepdown, side, climb, open, peck and the point count, with a profile summarised by its bounds. side reads as "outside"/"inside"/"on"; climb and open as a bool; points as an int; a NaN peck as null; every other value stays a float.
A Dictionary of the library's own numbers, sorted by key: side is 0 outside, 1 inside or 2 on its line; climb and open are 1 or 0; points is a count; a peck of none is null.
Sketches
class CadaclysmSketch extends RefCounted
A 2D sketch of points, lines, circles, arcs and free curves (Bezier, conic, NURBS), held by geometric constraints and dimensions and solved on request — the sketcher a parametric part starts from. Draw roughly, constrain, CadaclysmSketch.solve(), then hand CadaclysmSketch.profiles() to CadaclysmSolid.extrude() or any other verb that takes a CadaclysmProfile.
Entities and constraints are named by integer ids, which are never reused. Entity kinds are "point", "line", "circle", "arc" and "free_curve"; a constraint's kind is the name of the method that added it ("point_line_distance", ...), but for CadaclysmSketch.radius_of(), whose kind is "radius". Lengths are the kernel's own unitless numbers, angles radians. A sense is "auto" (taken from the geometry when the constraint is added), "positive" (a line and a circle: the centre on the left of the line, from its first point to its second; two circles: touching from outside) or "negative" (the centre on the right; one circle inside the other); an end is "start" or "end".
A constraint that conflicts with the ones already there is refused when it is added, the refusal naming the constraints it fights, so a sketch is never left over-constrained by an edit; a redundant one (already implied) is kept and reported by CadaclysmSketch.diagnose(). An edit that will not converge (CadaclysmSketch.set_value(), CadaclysmSketch.set_driving()) rolls the sketch back to where it was. Close it when done, or let the language's scope do it; see Lifetimes.
In Python an unknown sense or end name raises ValueError; every other wrapper raises its kernel error.
A refused call returns the empty value, -1 for a constraint, and the ids it names are in the sketch's last_ids(); the reason is in Cadaclysm.last_error().
CadaclysmSketch.from_profile()
static func from_profile(profile: CadaclysmProfile, infer: bool = true, tolerance: float = 1e-6) -> CadaclysmSketch
A sketch of profile's lines, arcs and curves, joined end to end by coincident constraints, holes included. With infer (the default) it also adds every constraint the geometry already meets within tolerance — horizontal and vertical lines, tangent joints, concentric arcs, equal radii — so the profile comes back as a sketch a designer can dimension. Ends within tolerance (1e-6 by default) count as joined.
CadaclysmSketch.close()
func close() -> void
Free this handle now. The garbage collector, or the language's scope, does it otherwise.
CadaclysmSketch.add_point()
func add_point(x: float, y: float) -> int
A free point at (x, y): its id. A coordinate that is not finite returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSketch.add_line()
func add_line(a: int, b: int) -> int
A line from the point a to the point b: its id. Refused for ids that are not two distinct points.
CadaclysmSketch.add_circle()
func add_circle(centre: int, r: float) -> int
A circle of radius r about the point centre: its id. Refused for a radius that is not positive and finite.
CadaclysmSketch.add_arc()
func add_arc(centre: int, start: int, end: int) -> int
A counter-clockwise arc about the point centre from the point start to the point end: its id. Its radius is start's distance from centre; end is held on that circle by the solve, not moved there now. The three must be different points.
CadaclysmSketch.add_bezier()
func add_bezier(start: int, c1: Variant, c2: Variant, to: Variant) -> int
A cubic Bezier free curve from the point start through the controls c1 and c2 (each an (x, y) pair) to a new end point at to: its id. The curve owns its control and end points (CadaclysmSketch.ends() lists them), which constraints and drags move like any other point.
CadaclysmSketch.add_conic()
func add_conic(start: int, control: Variant, to: Variant, weight: float) -> int
A rational quadratic (conic) free curve from the point start with the control control of weight to a new end point at to: its id. A weight below 1 is an ellipse's arc, 1 a parabola, above 1 a hyperbola.
CadaclysmSketch.add_nurbs()
func add_nurbs(start: int, points: Variant, knots: Variant, degree: int = 3, weights: PackedFloat64Array = PackedFloat64Array()) -> int
A NURBS free curve of degree (3 by default) from the point start through the control points after it, on knots: its id. weights is null for a plain B-spline, or one per control point counting the start (one more than points holds); any other count, a negative degree, or knots that do not fit the points and the degree, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
points is a PackedVector2Array or an array of points; weights a PackedFloat64Array, empty (the default) for none.
CadaclysmSketch.add_rect()
func add_rect(a: Variant, b: Variant) -> Dictionary
The rectangle with opposite corners a and b, as two lists: its four corner points, counter-clockwise from a, and its four sides (side i runs from corner i to corner i + 1). Its sides come held level and plumb by two horizontal and two vertical constraints, so a fix and two lengths constrain it fully.
a and b are Vector2s or two-number arrays; returns a Dictionary, {"corners": PackedInt64Array, "sides": PackedInt64Array} — empty on a refusal.
CadaclysmSketch.kind()
func kind(id: int) -> String
The kind of entity id: "point", "line", "circle", "arc" or "free_curve". An unknown or removed id returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSketch.point()
func point(id: int) -> Variant
The point id's position, as an (x, y) pair. Not a point, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
A Vector2, so single precision; null on a refusal. A point going in is a Vector2 or a two-number array.
CadaclysmSketch.set_point()
func set_point(id: int, x: float, y: float) -> bool
Moves the point id to (x, y) without solving — a raw write, as loading a saved sketch does.
CadaclysmSketch.radius()
func radius(id: int) -> float
The radius of the circle or arc id. (The RADIUS dimension is CadaclysmSketch.radius_of().)
NAN on a refusal.
CadaclysmSketch.set_radius()
func set_radius(id: int, r: float) -> bool
Sets the circle id's radius to r without solving. Refused for an arc, whose radius its points set, and for a radius that is not positive and finite.
CadaclysmSketch.ends()
func ends(id: int) -> PackedInt64Array
The points entity id runs between: a line's [a, b], an arc's [start, end], a free curve's [start, controls..., end]. Refused for a point or a circle.
CadaclysmSketch.set_construction()
func set_construction(id: int, on: bool = true) -> bool
Marks entity id as construction geometry (on, the default) or back: still solved and constrained, but never part of CadaclysmSketch.profiles() or CadaclysmSketch.open_chains().
CadaclysmSketch.is_construction()
func is_construction(id: int) -> bool
Whether entity id is construction geometry (false for an unknown id).
False, with no error, for an unknown or impossible id (negative, or past a u32). On a closed sketch it is false and Cadaclysm.last_error() says sketch: closed.
CadaclysmSketch.is_reference()
func is_reference(id: int) -> bool
Whether entity id is a reference copy of another sketch's, made by CadaclysmSketch.reference() (false for an unknown id).
False, with no error, for an unknown or impossible id (negative, or past a u32). On a closed sketch it is false and Cadaclysm.last_error() says sketch: closed.
CadaclysmSketch.remove_entity()
func remove_entity(id: int) -> PackedInt64Array
Removes entity id, each of its points no other entity uses, and every constraint on any of them: the removed constraint ids, ascending. A point a line, circle, arc or curve still uses is refused, returns null, false or an empty value (the reason in Cadaclysm.last_error()) naming those entities. Nothing is solved.
CadaclysmSketch.reference()
func reference(other: CadaclysmSketch, entity: int) -> int
A fixed construction copy of other's entity entity in this sketch, its id: something to dimension against that this sketch's solve never moves. CadaclysmSketch.update_reference() re-reads it. other must be a different sketch.
CadaclysmSketch.update_reference()
func update_reference(id: int, other: CadaclysmSketch) -> CadaclysmSolveReport
Re-reads the reference id from other (where other's solve has moved it) and re-solves this sketch, as a CadaclysmSolveReport.
CadaclysmSketch.coincident()
func coincident(a: int, b: int) -> int
The points a and b at one place. Each constraint method returns the new constraint's id, and refuses one that conflicts with the sketch, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
A refused constraint is -1; the ids of the constraints it conflicts with are the sketch's last_ids().
CadaclysmSketch.point_on_line()
func point_on_line(point: int, line: int) -> int
The point point on the line line, taken as infinite.
CadaclysmSketch.point_on_circle()
func point_on_circle(point: int, circle: int) -> int
The point point on the circle circle, or on an arc's whole circle.
CadaclysmSketch.horizontal()
func horizontal(a: int, b: int) -> int
The points a and b level with each other (one y).
CadaclysmSketch.vertical()
func vertical(a: int, b: int) -> int
The points a and b one above the other (one x).
CadaclysmSketch.parallel()
func parallel(a: int, b: int) -> int
The lines a and b parallel, either way round.
CadaclysmSketch.perpendicular()
func perpendicular(a: int, b: int) -> int
The lines a and b at right angles.
CadaclysmSketch.collinear()
func collinear(a: int, b: int) -> int
Line b's two ends on line a, taken as infinite.
CadaclysmSketch.tangent()
func tangent(a: int, b: int, sense: String = "auto") -> int
A line and a circle or arc, or two circles or arcs, tangent; sense picks the side ("auto": the side they are on now). Where the two meet end to end — the ends one point, or held together by a coincident when the tangent is added — it is held at that joint instead, their directions there running on smoothly, and sense plays no part (CadaclysmSketch.is_joint_tangent()).
CadaclysmSketch.tangent_at_end()
func tangent_at_end(curve: int, other: int, end: String = "start") -> int
The free curve curve's handle at its end ("start" or "end") along other when that is a line, or square to its radius at the curve's end when it is a circle or an arc.
CadaclysmSketch.concentric()
func concentric(a: int, b: int) -> int
The circles or arcs a and b about one centre.
CadaclysmSketch.equal_length()
func equal_length(a: int, b: int) -> int
The lines a and b the same length.
CadaclysmSketch.equal_radius()
func equal_radius(a: int, b: int) -> int
The circles or arcs a and b the same radius.
CadaclysmSketch.midpoint()
func midpoint(point: int, line: int) -> int
The point point at the middle of the line line.
CadaclysmSketch.symmetric()
func symmetric(a: int, b: int, about: int) -> int
The points a and b mirror images of each other across the line about.
CadaclysmSketch.fix()
func fix(entity: int) -> int
Every parameter of entity held where it is now: a point's position, a circle's centre and radius, ...
CadaclysmSketch.distance()
func distance(a: int, b: int, value: float, driving: bool = true) -> int
The points a and b value apart. Every dimension takes driving: true (the default) sets the geometry, false only reports what it measures (CadaclysmSketch.measure()), never conflicting.
CadaclysmSketch.point_line_distance()
func point_line_distance(point: int, line: int, value: float, driving: bool = true, sense: String = "auto") -> int
The point point value from the line line (taken as infinite), on the side sense says.
CadaclysmSketch.line_distance()
func line_distance(a: int, b: int, value: float, driving: bool = true, sense: String = "auto") -> int
Line b's start value from line a, on the side sense says — with CadaclysmSketch.parallel(), the gap between two lines. It is measured from the second line's start point, not from the line as a whole.
CadaclysmSketch.circle_line_distance()
func circle_line_distance(circle: int, line: int, value: float, driving: bool = true, sense: String = "auto") -> int
The circle circle's rim value from the line line (its centre's distance less the radius), on the side sense says.
CadaclysmSketch.circle_distance()
func circle_distance(a: int, b: int, value: float, driving: bool = true) -> int
The circles a and b value apart rim to rim: their centres' distance less both radii, negative where they overlap.
CadaclysmSketch.horizontal_distance()
func horizontal_distance(a: int, b: int, value: float, driving: bool = true) -> int
b's x less a's, signed, equal to value.
CadaclysmSketch.vertical_distance()
func vertical_distance(a: int, b: int, value: float, driving: bool = true) -> int
b's y less a's, signed, equal to value.
CadaclysmSketch.length()
func length(line: int, value: float, driving: bool = true) -> int
The line line value long.
CadaclysmSketch.angle()
func angle(a: int, b: int, value: float, driving: bool = true) -> int
The angle counter-clockwise from line a's direction to line b's, value radians.
CadaclysmSketch.radius_of()
func radius_of(circle: int, value: float, driving: bool = true) -> int
The circle or arc circle's radius value: the RADIUS dimension, kind "radius", named apart from CadaclysmSketch.radius(), which reads a radius.
CadaclysmSketch.diameter()
func diameter(circle: int, value: float, driving: bool = true) -> int
The circle or arc circle's diameter value.
CadaclysmSketch.smooth()
func smooth(a: int, b: int) -> int
Two curves joined end to end with matching tangent and curvature (G2): each a line, an arc or a free curve, at least one a free curve, meeting at an end (one point, or held together by a coincident). A free curve must be clamped at that end; two arcs, or a line and an arc, are refused, as there is no curvature to match. Kind "smooth".
CadaclysmSketch.translated()
func translated(a: int, b: int, from_point: int, to: int) -> int
The point b held at the point a moved by the step from the point from_ to the point to (b - a = to - from_): what a rectangular pattern holds each copied point with. Kind "translated".
CadaclysmSketch.rotated()
func rotated(a: int, b: int, centre: int, from_point: int, to: int) -> int
The point b held at the point a turned about the point centre by the turn that takes from_ to to: what a circular pattern holds each copied point with. from_ or to the same point as centre is refused. Kind "rotated".
CadaclysmSketch.add_polygon()
func add_polygon(centre: Variant, vertex: Variant, sides: int) -> Dictionary
A regular polygon of sides (3 to 1024) about the point centre, its corner 0 at vertex, as a Polygon: the sides held equal, with a construction circumcircle through the corners and a construction incircle tangent to side 0, both about the one centre point. Four degrees of freedom are left (centre, size, rotation); dimension either circle to size it. centre and vertex must be apart. A refusal leaves the sketch as it was.
CadaclysmSketch.chamfer()
func chamfer(a: int, b: int, da: float, db: float) -> Dictionary
Cuts the corner where the lines a and b meet, da along a and db along b from the corner, as a Chamfer. The two lines are trimmed to the new ends and a new line joins them; the old corner stays as a construction point (the virtual sharp, on both lines) with the two distances as driving dimensions, so the degrees of freedom are unchanged. The lines must meet at an end and not be parallel, neither a reference, each distance positive and shorter than its line, and no tangent or smooth held at that end. A length dimension on a trimmed line now measures the trimmed line. A refusal, or a solve that fails, leaves the sketch as it was.
CadaclysmSketch.chamfer_angle()
func chamfer_angle(a: int, b: int, da: float, angle: float) -> Dictionary
As CadaclysmSketch.chamfer(), with da along a and angle (radians) the interior angle at the new point on a between a and the chamfer; the second dimension is that angle. The angle must leave a chamfer shorter than b allows.
CadaclysmSketch.pattern_rectangular()
func pattern_rectangular(entities: Variant, d1: Variant, n1: int, d2: Vector2 = Vector2.ZERO, n2: int = 1) -> Dictionary
Copies entities (any kinds) into a grid of n1 by n2 instances, the source counted, d1 and d2 each an (x, y) step, as a SketchPattern. Each copied point is held to the one before it by CadaclysmSketch.translated(); the first step along each direction is set by driving horizontal and vertical distances, so set_value on one respaces the whole grid and a fully constrained sketch stays so. Construction flags are copied. n1, n2 at least 1, n1 * n2 at least 2 and at most 10 000 instances; an entity dead or given twice is refused, and the sketch left as it was.
CadaclysmSketch.pattern_circular()
func pattern_circular(entities: Variant, centre: int, count: int, step: float) -> Dictionary
Copies entities round the point centre: count instances (at least 2, the source counted), each turned step radians counter-clockwise from the last, as a SketchPattern. Each copied point is held by CadaclysmSketch.rotated(); two construction lines from the centre and a driving angle dimension carry the step, so set_value on it respaces the copies. A first point of the source on centre, or a step of 0, is refused and the sketch left as it was.
CadaclysmSketch.auto_constrain()
func auto_constrain(tolerance: float = 0.0, dimensions: bool = false) -> PackedInt64Array
Adds the constraints the geometry already satisfies within tolerance (0 or null takes 1e-6 of the sketch's extent), as the new constraint ids, ascending: coincident ends, horizontal and vertical lines, tangents at joined ends, parallel, perpendicular, concentric, equal radius and length, midpoints and points on lines and circles. A candidate is kept only where it removes a degree of freedom without being redundant or conflicting. With dimensions, driving dimensions at the measured values follow (radii, lengths, angles, an anchor and the distances to it) until nothing is left free. One diagnosis runs per candidate: fine for hand-sized sketches. A failed solve leaves the sketch as it was.
CadaclysmSketch.constraints()
func constraints() -> PackedInt64Array
The live constraint ids, ascending.
CadaclysmSketch.constraint_kind()
func constraint_kind(id: int) -> String
The kind of constraint id, e.g. "point_line_distance". An unknown or removed id returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSketch.constraint_refs()
func constraint_refs(id: int) -> PackedInt64Array
The entity ids constraint id was made on, in the order they were given.
CadaclysmSketch.constraint_value()
func constraint_value(id: int) -> Variant
The value of the dimension id; null for a constraint that is not a dimension. An unknown id returns null, false or an empty value (the reason in Cadaclysm.last_error()).
A float, or null for a constraint that is not a dimension — and for an unknown id, the reason then in Cadaclysm.last_error().
CadaclysmSketch.constraint_driving()
func constraint_driving(id: int) -> bool
Whether the dimension id drives the geometry; false for a constraint that is not a dimension. An unknown id returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSketch.constraint_sense()
func constraint_sense(id: int) -> String
The sense of constraint id as the sketch holds it, "auto" resolved to the side it took; "auto" for a kind without one.
CadaclysmSketch.constraint_end()
func constraint_end(id: int) -> String
The end ("start" or "end") of the free curve a CadaclysmSketch.tangent_at_end() constraint id holds; "start" for a kind without one. An unknown id returns null, false or an empty value (the reason in Cadaclysm.last_error()).
CadaclysmSketch.is_joint_tangent()
func is_joint_tangent(id: int) -> bool
Whether the tangent id is held at a joint (two curves meeting end to end) rather than as a touch; false for any other constraint.
False, with no error, for an unknown or impossible id (negative, or past a u32). On a closed sketch it is false and Cadaclysm.last_error() says sketch: closed.
CadaclysmSketch.remove()
func remove(id: int) -> bool
Removes the constraint id. Nothing is solved; a joint tangent the removed coincident held goes back to a touch.
CadaclysmSketch.set_value()
func set_value(id: int, value: float) -> CadaclysmSolveReport
Sets the dimension id to value and re-solves, as a CadaclysmSolveReport. One that will not converge is refused, returns null, false or an empty value (the reason in Cadaclysm.last_error()), and the sketch is left as it was.
CadaclysmSketch.set_driving()
func set_driving(id: int, driving: bool) -> CadaclysmSolveReport
Makes the dimension id drive the geometry (true) or only report it, and re-solves, as a CadaclysmSolveReport. Made driving, it first takes the value it measures now, so nothing moves; one that would conflict is refused and the sketch left as it was.
CadaclysmSketch.measure()
func measure(id: int) -> float
What the geometry measures for the dimension id right now, driving or not.
NAN on a refusal.
CadaclysmSketch.solve()
func solve() -> CadaclysmSolveReport
Solves the sketch, as a CadaclysmSolveReport. Each independent part is solved alone, every point moving as little as it can; a part that conflicts or does not converge is put back where it was and named in the report — reported, not raised.
CadaclysmSketch.drag()
func drag(moves: Dictionary) -> CadaclysmSolveReport
Drags each point id in moves (a mapping of id to (x, y)) towards its target while the constraints hold, as a pointer drag does, as a CadaclysmSolveReport: the dragged points go where they can and everything else moves as little as it can; a fully constrained point stays put. An id that is not a point returns null, false or an empty value (the reason in Cadaclysm.last_error()). The moves are sent in ascending id order, whatever order they are given in, and an id given twice is refused where the language can hold one (sketch_drag: point <id> given twice).
moves is a Dictionary of point id to its target, a Vector2 or a two-number array: {id: Vector2(x, y)}; a Dictionary cannot repeat an id.
CadaclysmSketch.diagnose()
func diagnose() -> CadaclysmDof
The sketch's degrees of freedom, as a CadaclysmDof: whole and per independent part.
CadaclysmSketch.profiles()
func profiles(tolerance: float = 1e-6) -> Array[CadaclysmProfile]
The closed loops among the solved, non-construction curves, as CadaclysmProfile values of exact segments (lines, arcs, the free curves' own shapes); a loop inside another becomes its hole. Ends within tolerance (1e-6 by default) join.
CadaclysmSketch.open_chains()
func open_chains(tolerance: float = 1e-6) -> Array[CadaclysmProfile]
The chains of curves that do not close, as open CadaclysmProfile values — sweep paths; ends within tolerance join.
create Godot only
static func create() -> CadaclysmSketch
Python's Sketch(): a new, empty sketch. (new is GDScript's own, as CadaclysmFrame.create is, so the constructor is create.)
raw_point Godot only
func raw_point(id: int) -> PackedFloat64Array
The point id's position as [x, y] in double precision, a PackedFloat64Array, empty on a refusal. CadaclysmSketch.point() is a single-precision Vector2.
last_ids Godot only
func last_ids() -> PackedInt64Array
GDScript has no exceptions, so a refused call cannot carry BuildError.ids: the sketch keeps them instead. last_ids() is the ids this sketch's last call was refused with, as a PackedInt64Array — the constraints a new constraint, value or reference conflicts with, or the entities still using a point — and empty after a call that worked or a refusal that names none. Read it straight after the call, with the reason in Cadaclysm.last_error().
CadaclysmSolveReport
class CadaclysmSolveReport extends RefCounted
What a CadaclysmSketch.solve(), CadaclysmSketch.drag(), CadaclysmSketch.set_value(), CadaclysmSketch.set_driving() or CadaclysmSketch.update_reference() did, as plain data.
CadaclysmSolveReport.status
var status: String # read-only
"converged", "conflicting" (constraints that cannot all hold) or "diverged" (no solution found within the iteration budget). The library hands the number back as a double and every wrapper converts it exactly: a value that is not a whole number in range is an error naming the call, never a status.
CadaclysmSolveReport.iterations
var iterations: int # read-only
The most solver iterations any one part took (each part is solved alone).
CadaclysmSolveReport.max_residual
var max_residual: float # read-only
The largest constraint residual left, scaled by the sketch's size; 0 when nothing was left to solve.
CadaclysmSolveReport.ids
var ids: PackedInt64Array # read-only
The constraints a conflict ran into, or the worst ones of a diverged solve; empty when it converged.
CadaclysmDof
class CadaclysmDof extends RefCounted
A sketch's degrees of freedom, as CadaclysmSketch.diagnose() returns them: plain data, read after a solve. A sketch is "under" constrained while something can still move, "full" when nothing can and nothing fights, "over" when constraints fight.
CadaclysmDof.free
var free: int # read-only
How many degrees of freedom are left: the unknowns less the rank of the constraint equations. The counts arrive as doubles and are converted exactly: a value that is not a whole number in range is an error naming the call, never a state.
CadaclysmDof.redundant
var redundant: PackedInt64Array # read-only
The constraint ids already implied by earlier ones — harmless, kept.
CadaclysmDof.conflicting
var conflicting: PackedInt64Array # read-only
The constraint ids that fight earlier ones.
CadaclysmDof.free_entities
var free_entities: PackedInt64Array # read-only
The entity ids that can still move, ascending (references never).
CadaclysmDof.parts
var parts: Array[CadaclysmPartDof] # read-only
The independent parts the sketch splits into, as CadaclysmPartDof values: each solved, and dragged, alone.
CadaclysmPartDof
class CadaclysmPartDof extends RefCounted
One independent part of a diagnosed sketch — constraints and the unknowns they share, solved apart from the rest: one of CadaclysmDof.parts. Plain data.
CadaclysmPartDof.constraints
var constraints: PackedInt64Array # read-only
The constraint ids in the part, in the order they were added.
CadaclysmPartDof.redundant
var redundant: PackedInt64Array # read-only
Its constraints already implied by earlier ones.
CadaclysmPartDof.conflicting
var conflicting: PackedInt64Array # read-only
Its constraints that fight earlier ones.
CadaclysmPartDof.free_entities
var free_entities: PackedInt64Array # read-only
Its entities that can still move; a curve whose points lie in two parts may be in both.
Garments
A garment: patterns (a closed outline, a fabric, a grain and a seam allowance, placed by a frame), the seams that sew arc-length ranges of two patterns together, and the fabrics, with CLO-compatible parameters — the flat pattern a cloth simulation starts from. Lengths are millimetres in the session API. Patterns, seams and fabrics are named by integer ids, which are never reused. A fabric is twenty numbers in the order of Garment.FABRIC_FIELDS (stretch_warp, ..., internal_damping); a notch kind is NOTCH_SLIT, NOTCH_V, NOTCH_T, NOTCH_CASTLE or NOTCH_U; an internal line is LINE, FOLD or DART.
A refused call raises the kernel's error with the call's name first (garment_add_seam: unknown pattern 9). The lists the library lends are copied before a call returns, so they survive later edits. Close it when done, or let the language's scope do it; see Lifetimes.
A garment is also a Document node's value: garment.fabric, garment.pattern, garment.seam and garment.garment nodes evaluate to one, read with Document.result_garment.
Not in this wrapper yet.
Garment.FABRIC_FIELDS
The names of a fabric's twenty parameters, in order: stretch_warp, stretch_weft, shear_left, shear_right, bending_warp, bending_weft, bending_bias_left, bending_bias_right, the four buckling_ratio_*, the four buckling_stiffness_*, density, thickness, friction and internal_damping.
Not in this wrapper yet.
Garment.from_aama
A garment read from AAMA DXF text: its patterns over one fabric, id 0, called "imported", with all-zero parameters. Text that is not AAMA DXF returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Not in this wrapper yet.
Garment.close
Free this handle now. Leaving a with block or the garbage collector does the same.
Not in this wrapper yet.
Garment.add_fabric
A fabric called name with its twenty parameters, as a list in FABRIC_FIELDS order or a dict keyed by those names: its id. A negative parameter is reported by Garment.validate.
Not in this wrapper yet.
Garment.fabric_params
Fabric fabric's twenty parameters, in FABRIC_FIELDS order. An unknown id returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Not in this wrapper yet.
Garment.fabric_name
Fabric fabric's name. An unknown id returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Not in this wrapper yet.
Garment.add_pattern
A pattern called name over the closed outline (its holes are kept), with the grain direction (x, y), a fabric id, a layer (stacking order) and the seam allowance: one width for every side, or one per side. Its id. The pattern starts on the origin, flat. An unknown fabric or an allowance count that fits neither returns null, false or an empty value (the reason in Cadaclysm.last_error()); a zero grain is reported by Garment.validate.
Not in this wrapper yet.
Garment.pattern_outline
Pattern pattern's outline, as a new CadaclysmProfile.
Not in this wrapper yet.
Garment.pattern_frame
The frame pattern pattern is placed by: its origin, then its x, y and z axes, as four points.
Not in this wrapper yet.
Garment.pattern_set_frame
Places pattern pattern by frame: twelve numbers, the origin then the x, y and z axes.
Not in this wrapper yet.
Garment.pattern_set_wrap
Wraps pattern pattern round a cylinder: seven numbers, the axis origin, the axis direction and the radius. null clears the wrap.
Not in this wrapper yet.
Garment.pattern_add_notch
Adds a notch to pattern pattern at arc length at, of kind (Garment.NOTCH_*) and depth. An arc length outside the outline is reported by Garment.validate; a position or depth that is not finite returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Not in this wrapper yet.
Garment.pattern_notches
Pattern pattern's notches, as (at, kind, depth) triples.
Not in this wrapper yet.
Garment.pattern_add_internal
Adds an internal line to pattern pattern: kind (LINE, FOLD or DART), path a CadaclysmProfile read as an open path: the profile's segments are copied as given (a closed profile keeps its closing segment); holes are ignored.
Not in this wrapper yet.
Garment.remove_pattern
Removes pattern pattern and every seam that names it.
Not in this wrapper yet.
Garment.add_seam
Sews pattern a between arc lengths a_from and a_to to pattern b between b_from and b_to, reversed when one runs against the other: its id. An unknown pattern returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Not in this wrapper yet.
Garment.validate
Checks the garment, measuring outlines to accuracy (a fraction in (0, 1), 0.01 by default), and returns the issues found as Issue values, an empty list for a garment that is clean. Any edit afterwards clears them.
Not in this wrapper yet.
Garment.issue
Issue index of the last Garment.validate, as an Issue. Before a validation, or past the last issue, returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Not in this wrapper yet.
Garment.cut_line
Pattern pattern's cut line (the outline offset by its allowance) flattened to tolerance (0.1 by default), as (x, y) points.
Not in this wrapper yet.
Garment.range_points
The points of pattern pattern's outline between arc lengths start and end, flattened to tolerance (0.1 by default), as (x, y) points.
Not in this wrapper yet.
Garment.to_aama
The patterns as AAMA DXF text, curves flattened to tolerance (0.1 by default), with author in the header when given. The text is written as metric, so a garment from a non-millimetre document must be converted to millimetres first.
Not in this wrapper yet.
Issue
One thing Garment.validate found, as a named tuple. severity is Garment.ERROR or Garment.WARNING; kind what was found (Garment.SEAM_OVERLAP, Garment.SEAM_LENGTH_MISMATCH, ...); ratio the length ratio of a seam length mismatch, null for every other kind; message the issue in words, naming the parts.
Not in this wrapper yet.
GarmentSeam
A seam read back by Garment.seam, as a named tuple: pattern a's arc-length range a_from to a_to sewn to pattern b's b_from to b_to, reversed when one range runs against the other.
Not in this wrapper yet.
Cloth
A cloth: a Garment simulated on an avatar. The garment's patterns are meshed and arranged round the avatar; each step then sews and drapes at once: the seam pairs pull together and weld while gravity pulls the cloth down. Gravity acts from the first frame, so a garment is usually sewn with it off and draped after: create the cloth with gravity=(0, 0, 0) (in C, the options gravity.x, gravity.y and gravity.z, indices 4 to 6, at 0), step about 60 frames until status().welded_pairs reaches status().seam_pairs, then set_options back to the defaults and step on to drape. Units are grams, millimetres and seconds, as the garment's.
avatar is None (no body: the cloth only falls), the bytes of a binary or ASCII STL file, or (positions, indices): xyz triples and index triples. options overrides Cloth.default_options() by the kernel's own names. The cloth does not keep the garment: a later edit to it changes nothing until Cloth.remesh_pattern. Close it when done, or let the language's scope do it; see Lifetimes.
The options are twenty numbers, in the order of Cloth.OPTION_FIELDS: particle_distance, frame_dt, substeps, iterations, gravity.x, gravity.y, gravity.z, damping, local_damping, air_drag, air_lift, air_density, sewing_stiffness, sewing_speed, weld_distance, avatar_thickness, self_thickness, self_stiffness, self_collision and drag_stiffness. The gravity components are the dotted names gravity.x, gravity.y and gravity.z; options and set_options also take all three as one gravity=(x, y, z), as in set_options(gravity=(0, 0, 0)) (not both spellings at once). particle_distance is the mesh spacing in mm and is fixed once the cloth exists. self_thickness is the *minimum* contact thickness of the cloth against itself: a fabric thicker than it separates at its own thickness, a thinner one at this, and it must stay below weld_distance so that seams still close.
A blown-up simulation does not raise: read Cloth.status. non_finite counts the particles whose position or velocity is not finite, dropped the self-collision elements that were too large or not finite to be hashed, and max_speed is the fastest finite particle in mm/s; a healthy cloth has non_finite and dropped at zero.
The lists the library lends (positions, triangles, links) are borrowed from the cloth in the C ABI and stay valid only until the next call on the same cloth; this wrapper copies them before a call returns, so they survive step and Cloth.remesh_pattern, which can change the vertex and triangle counts: read the lists again afterwards. A refused call raises the kernel's error with the call's name first (cloth_pin: vertex 9999 is not a sim vertex (2731 vertices)).
On the GPU: in the browser, a WebGPU View steps a cloth on the graphics card and writes its vertices straight into what it draws — showCloth(cloth) shows and uploads it, stepCloth(id, frames) steps it, clothPositions(id) and clothHealth(id) read it back (promises), and pinCloth, unpinCloth, dragCloth and setClothOptions edit it; clothGpu is false on WebGL2, where the cloth stays on the CPU. Not in this wrapper yet: the GPU cloth is the web View's only, the View's C ABI and the other wrappers come later. The GPU steps the cloth without the intersection analysis that untangles a cloth caught through itself: showCloth uploads it with the analysis off, whatever the cloth's options; the analysis on the GPU comes later.
Not in this wrapper yet.
Cloth.OPTION_FIELDS
The names of the twenty options, in order: particle_distance, frame_dt, substeps, iterations, gravity.x, gravity.y, gravity.z, damping, local_damping, air_drag, air_lift, air_density, sewing_stiffness, sewing_speed, weld_distance, avatar_thickness, self_thickness, self_stiffness, self_collision and drag_stiffness.
Not in this wrapper yet.
Cloth.STATUS_FIELDS
The names of ClothStatus's eight fields, in order: frame, vertices, triangles, seam_pairs, welded_pairs, non_finite, dropped and max_speed.
Not in this wrapper yet.
Cloth.close
Free this handle now. Leaving a with block or the garbage collector does the same.
Not in this wrapper yet.
Cloth.default_options
The options a new cloth starts with, as a dict keyed by OPTION_FIELDS name: particle_distance, frame_dt, substeps, iterations, gravity.x, gravity.y, gravity.z, damping, local_damping, air_drag, air_lift, air_density, sewing_stiffness, sewing_speed, weld_distance, avatar_thickness, self_thickness, self_stiffness, self_collision and drag_stiffness.
Not in this wrapper yet.
Cloth.set_options
Merges changes (by option name, or gravity as one (x, y, z), as in set_options(gravity=(0, 0, 0))) into the current options. particle_distance cannot change, and a refused set (an unknown name, a self_thickness or fabric thickness that is not below weld_distance) returns null, false or an empty value (the reason in Cadaclysm.last_error()) and leaves the options as they were.
Not in this wrapper yet.
Cloth.step
Advances the simulation by frames frames (1 by default), each frame_dt seconds, sewing and draping together under the current options (sew with gravity off first: see Cloth). Check Cloth.status afterwards for a blow-up.
Not in this wrapper yet.
Cloth.positions
The current position of every sim vertex, in mm, as (x, y, z) triples. A copy.
Not in this wrapper yet.
Cloth.rest
Each sim vertex's arranged starting position in 3D, in mm, as (x, y, z) triples. A copy.
Not in this wrapper yet.
Cloth.triangles
The sim mesh's triangles, as triples of vertex indices into Cloth.positions.
Not in this wrapper yet.
Cloth.vertex_patterns
The id of the garment pattern each sim vertex belongs to. Every sim vertex keeps its own pattern: a weld across a seam merges the two vertices' particles, not the vertices.
Not in this wrapper yet.
Cloth.vertex_links
Each sim vertex's exact absolute (u, v) on its pattern, in mm, as pairs.
Not in this wrapper yet.
Cloth.vertex_link
Vertex v's (pattern, u, v): its pattern id and its exact (u, v) on it, in mm. A vertex past the last returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Not in this wrapper yet.
Cloth.pin
Pins vertex v at at (x, y, z in mm), or where it is now when null. A pinned vertex does not move until Cloth.unpin. An unknown vertex returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Not in this wrapper yet.
Cloth.unpin
Releases vertex v's pin. An unknown vertex returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Not in this wrapper yet.
Cloth.drag
Pulls vertex v towards target (x, y, z in mm) with the drag_stiffness spring; null releases the drag. An unknown vertex returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Not in this wrapper yet.
Cloth.remesh_pattern
Meshes pattern pattern of garment again after its outline changed there, keeping the rest of the cloth where it is. The vertex and triangle counts may change: read the lists again. An unknown pattern returns null, false or an empty value (the reason in Cadaclysm.last_error()).
Not in this wrapper yet.
ClothStatus
The state of a simulation, as Cloth.status returns it, a named tuple: the frame count, the sim vertices and triangles, the seam_pairs in the sim mesh and the welded_pairs closed so far (sewing is done when welded_pairs == seam_pairs), then the health: non_finite live particles (a position or velocity that is not finite), dropped (the most hash elements one self-collision gather dropped during the last step, which only a blown-up state produces) and max_speed, the fastest finite particle, in mm/s. The counts are converted exactly; a cloth is healthy when non_finite and dropped are both zero.
Not in this wrapper yet.
Errors
What the kernel refused, in its own words: a profile that crosses itself, a fillet too large for its faces, a boolean with nothing left. Raised by the call that failed, at once.
No error type: a kernel call that fails returns null (or false, -1 or an empty value), reports the reason with push_error, and leaves it in Cadaclysm.last_error(), as the reader's do.
BuildError.ids
The ids a CadaclysmSketch refusal names, as a list: the constraints a new constraint, value or reference conflicts with (CadaclysmSketch.coincident() and the other constraint methods, CadaclysmSketch.set_value(), CadaclysmSketch.set_driving(), CadaclysmSketch.update_reference()), or the entities still using a point (CadaclysmSketch.remove_entity()). Empty when the refusal names none, and for every error outside a sketch — so a sketcher's interface can mark the clash without reading the text.
No error type: a kernel call that fails returns null (or false, -1 or an empty value), reports the reason with push_error, and leaves it in Cadaclysm.last_error(), as the reader's do.
What borrows, what to close
Every class is RefCounted: an object is freed when the last reference to it goes. close() frees a CadaclysmScene, CadaclysmSolid or CadaclysmSweepPath at once, and release() a CadaclysmBrep, a CadaclysmFemMesh or a CadaclysmSolidFemMesh; a node or placement of a closed scene then fails rather than reading freed memory. GDScript has no exceptions: a call that fails returns null (or false, -1 or an empty value), reports the reason with push_error, and leaves it in Cadaclysm.last_error() — the kernel's calls too — until the next call that works.
Nothing borrows: CadaclysmNode.mesh copies the triangles out of the scene into a CadaclysmMesh of packed arrays, and CadaclysmNode.edges its lines into a CadaclysmPolylines; both outlive CadaclysmScene.close(). array_mesh() and instantiate() build Godot's own ArrayMeshes, which live on too. CadaclysmSolid.mesh() is a copy as well, so meshing the solid again changes nothing already handed back. CadaclysmFemMesh is the one handle of your own here: its arrays are copies too, so nothing it hands back can go stale, but the handle itself holds the library's memory until release() or the last reference to it goes — and neither CadaclysmScene.close() nor meshing a solid again touches it.
Strings and arrays are always copied on the way out. CadaclysmScene.realize_all() meshes on every core inside the library. A scene, its nodes and its placements share one handle that is not safe to use from two threads at once: use them from one thread at a time. Cadaclysm.last_error() is per thread, so a failure is read on the thread that failed.