Luce packages
LuceLuce BaseLuciaOS

dymokomi/luce-cad

Source of release 0.9.5

0.9.5 / src / modeling / thresholds.lucb

## Thresholds shared across modeling: module-level names for the small
## numbers many operations compare against. Each is a fixed number, not a
## project tolerance (those come from the shape's CadTolerances).

## The tolerance a sketch's profiles are found at, as a share of the
## sketch's size.
let sketch_tolerance_share: f64 = 0.0001

## A boolean-style Work: the tolerance it starts with (set from the shapes
## once they are gathered) and the least size it takes, so an empty or
## point-like set of faces still has a positive scale.
let work_start_tolerance: f64 = 1e-9
let least_work_size: f64 = 1e-6

## Unit directions: two count as parallel when |a·b| is within this of 1
## (or |a×b| is below it), and as square when |a·b| is below it. The tight
## and loose variants are for checks that need exact agreement, and for
## directions known only roughly (traced edges' end tangents, normals read
## off faces).
let parallel_slack: f64 = 1e-9
let parallel_slack_tight: f64 = 1e-12
let parallel_slack_loose: f64 = 1e-6

## An angle (radians) within this of a boundary (zero, a half or a full
## turn, or a whole number of quarter turns when counting spans) counts as
## on it.
let angle_slack: f64 = 1e-9

## A length below this share of the length it is measured against (a size,
## a radius, a span) counts as zero; the tight variant for exact checks.
let relative_zero: f64 = 1e-9
let relative_zero_tight: f64 = 1e-12

## A curvature times a length below this is no bend: the curve runs flat.
let flat_bend: f64 = 1e-12

## A determinant of unit-direction rows (1 - (a·b)², or one relative to its
## rows' squared lengths) below this is singular: the directions run along
## one line.
let singular_floor: f64 = 1e-12

## Gaussian elimination: a pivot below this is singular.
let pivot_floor: f64 = 1e-14

## Three unit plane normals whose triple product is below this meet in no
## single point.
let planes_meet_floor: f64 = 1e-9

## Newton solves on a shape stop when the residual is within this share of
## the shape's tolerance.
let solve_settled_share: f64 = 0.01

## The tolerance tools turned about an axis (blend rims, full rounds) are
## made at, as a share of their reach from the axis.
let turned_tool_share: f64 = 1e-7

## Extrusions: the least distance one takes; how far past a body, as a
## share of its extent along the way plus a share of the sketch's size, an
## extent through it reaches; and a height within this share of the
## sketch's size of the start counts as level with it.
let least_extrude_distance: f64 = 1e-9
let past_body_share: f64 = 0.01
let past_body_sketch_share: f64 = 0.001
let extent_level_share: f64 = 1e-6