ConstructCraft

cc_core API

← API reference · Generated from the source by cargo run -p api_doc; edit the doc comments, not this page.

Core BIM data model for ConstructCraft. The Project is the single source of truth. Every view, schedule and sheet is a query over it; all geometry is derived. Edits go through Document::edit, which records a Transaction for undo/redo.

Modules

Module Items Summary
cc_core 0 Core BIM data model for ConstructCraft.
cc_core::arc 4 Circular arcs in plan, described like polyline arcs by their two ends and a bulge: tan(sweep / 4), positive when the arc turns counter-clockwise from the start to the end, 0 for a straight line, ±1 for a half circle.
cc_core::bar_marks 20 Bar marks: the names (N1, N2…) bending schedules and bar tags give the bars of reinforcement, one per bar shape: the same diameter, steel grade and shape (legs, radii, bends and hooks, within a length tolerance and ANGLE_TOLERANCE_DEG, read from either end or mirrored).
cc_core::bar_tag 5 Bar tags: annotations that write a reinforcement set’s bars in a plan, an elevation or a section — 25 N1 Ø12.5 c/12 C=500: the count, the mark, the diameter in millimeters, the spacing in centimeters (sets without one leave it out) and the length of one bar in centimeters (C=var when the set’s bars differ).
cc_core::bracing 11 Parametric bracing: a host element that holds the parameters of the braces of one bay of a frame (the bay line between two column axes, the storey height, the number of storeys, the pattern and the brace type) and owns the ordinary beams made from them, kept in step like a truss’s (see crate::member_host).
cc_core::browser 13 Project browser organization: named schemes that group the views of the project browser by view type, level, discipline or phase, in that order of nesting.
cc_core::cad 20 Imported CAD drawings (DWG and DXF underlays).
cc_core::callout 5 Crop regions and callouts.
cc_core::component 25 Parametric components: user-defined objects (furniture, fixtures, casework…) whose solids are sized by named parameters.
cc_core::component_file 14 .ccomp component files: a component definition with all its types and the materials it uses, to share components between projects.
cc_core::component_ref 13 Reference planes, reference lines and labeled dimensions of a component: the skeleton that parameters drive and pieces follow.
cc_core::component_script 15 Scripted component pieces: the model side.
cc_core::connection 7 Steel and timber connections: an element at one end of a column or beam (member, end) of a standard kind, whose plates and bolts cc_geom::connection derives from the member’s geometry on every build.
cc_core::curtain 20 Curtain walls: walls made of a grid of panels and mullions.
cc_core::design_option 4 Design options: alternative sets of elements within one project.
cc_core::detail 9 Detail lines: view-specific 2D curves (lines, arcs, circles and whole or partial ellipses, the SketchCurve geometry) drawn in one view with a line style.
cc_core::detail_component 14 Detail components: reusable 2D components for construction details.
cc_core::dim_line 7 The dimension line of linear and aligned dimensions: lining it up with the lines of other dimensions, and chains of dimensions that share one line (continuous dimensioning).
cc_core::dim_refs 5 Associative dimensions: each end of a dimension may reference a point of an element (stored in that element’s own frame, plus a height in elevations and sections) or a level.
cc_core::dim_style 4 How a dimension type draws its dimensions: the marks at the ends of the dimension line, the witness lines, the pens and the text around the value.
cc_core::document 3  
cc_core::element 36  
cc_core::element::slab_bars 3 Limits of slab reinforcement.
cc_core::element::wall_bars 5 Limits of wall reinforcement.
cc_core::expr 6 Arithmetic expressions over named parameters, used by component geometry: numbers, parameter names, + - * / ^, parentheses, unary minus and the functions min, max, abs, sqrt, round, floor, ceil, sin, cos, tan (degrees).
cc_core::fill_pattern 22 The project’s own fill patterns (hatches): families of parallel, possibly dashed lines, as in the plain-text .pat format CAD programs share (see crate::pat).
cc_core::graph_binding 2 Elements made by visual programming graphs.
cc_core::graphics 14 View graphics: what a view shows and how it draws it.
cc_core::grid 8 Grid naming and alignment.
cc_core::ids 1  
cc_core::level_mark 5 Level marks: annotations that write the elevation of a point in a plan, an elevation or a section — the finished level above a shelf line and the raw (structural) level under it.
cc_core::lightning 8 Lightning protection: the conductors of a lightning protection system (on the roof, down the walls and in the ground) and the protection classes the coverage check uses.
cc_core::mass 7 Conceptual masses: volumes for massing studies.
cc_core::material 16 Materials: identity data, graphics in views (shading, transparency, surface and cut patterns), render appearance and physical properties.
cc_core::member_host 5 Member hosts: elements with no geometry of their own (steel buildings, trusses, bracings, wall framings) that own ordinary columns and beams laid out from their parameters.
cc_core::mep 16 Building services (MEP): plumbing, electrical, structured cabling and lightning protection systems, the pipe, conduit and cable tray segments that run them, the valves on pipes, and the data that makes a component a plumbing fixture or an electrical, communications or lightning protection device.
cc_core::openings 11 Doors and windows as components: the built-in definitions that the template’s door and window types use and that older files’ door and window types become.
cc_core::pad 8 Building pads: a flat area at an elevation, graded into the terrain that hosts it, with cut and fill slopes running out from its edges to the existing ground.
cc_core::paint 4 Painted faces: a material laid on one surface of an element, over the material its type gives it (a painted wall face, a tiled floor top).
cc_core::pat 10 The plain-text .pat hatch pattern format many CAD programs read and write, as publicly described: text ;%UNITS=MM *NAME, optional description ;%TYPE=MODEL angle, x-origin, y-origin, delta-x, delta-y [, dash1, dash2, ...]rust A header line starting with * opens a pattern; each following line is a family of parallel lines through the origin at the angle (degrees), the next line shifted by delta-x along it and delta-y across it, with optional dashes (positive drawn, negative gaps, zero dots).
cc_core::persist 12 .ccad project files: a versioned RON document.
cc_core::phase 10 Construction phases (renovation work).
cc_core::pile 29 Piles and pile caps.
cc_core::profile 14 Profiles of component pieces: closed outlines of straight segments, arcs and parts of ellipses drawn on one of the component’s planes (plan, front or side), with every coordinate an crate::expr expression, and the solids made from them: an extrusion across the plane or a revolution about an axis in it.
cc_core::profile_catalog 6 Built-in profile catalogs: the standard series of rolled, cold-formed, timber and hollow sections, as tables (cells split by ;, since the designations write decimals with a comma) compiled into the binary and parsed once.
cc_core::profile_sweep 7 Swept profiles: a closed profile, held by the element’s type, carried along a path drawn in plan at a height above the element’s level.
cc_core::profiles_project 7 Structural profiles in the project: lookups and repair of loaded files.
cc_core::project 9  
cc_core::properties 6 Property and quantity sets carried over from IFC files: named sets of named values, each value keeping its IFC measure type.
cc_core::ramp 7 Ramps: the plan shapes of a ramp element and the accessibility rules of its type (steepest slope, highest rise of one flight, shortest landing).
cc_core::raster 6 Raster images kept in a project (imported pictures, scanned drawings): the file’s own bytes, unchanged, with the format and pixel size.
cc_core::recovery 9 Crash recovery: while a project has unsaved changes, a copy of it is written now and then to a recovery folder, so a crash (or a power cut) loses at most the last few minutes of work.
cc_core::region 3 Regions: 2D areas drawn in one view, owned by it like detail lines and text notes (Element::owner_view), in the view’s drawing coordinates (meters).
cc_core::render_settings 28 Per-view settings of photorealistic rendering (path tracing).
cc_core::repair 0 Repair of projects read from files, which may be damaged or crafted: invalid numbers and dangling references are removed or reset so the rest of the program can rely on a consistent model.
cc_core::roofing 5 Roof coverings and framing.
cc_core::scale 4 Drawing scales as people read them: 1:50 in metric projects, the customary 1/4" = 1'-0" in imperial ones.
cc_core::schedule 15 Schedule definitions: which fields a schedule shows, how rows are filtered, sorted and grouped, how each column is formatted and how the table looks on paper.
cc_core::section_props 1 Geometric properties of a section outline (area, centroid, second moments, moduli, radii of gyration, torsion constant, mass per length), computed exactly for the polygon with Green’s theorem.
cc_core::shaft 3 Shaft openings: a vertical opening with an outline in plan, from its level (plus base_offset) up to a level or a height, that cuts every floor, ceiling and roof it passes through.
cc_core::site 7 Where the project stands on Earth: the geographic position of the project origin, its height above sea level, the direction of true north and the parts of its postal address, plus the conversion between latitude/longitude and the project’s own coordinates (meters) used to bring map data in.
cc_core::sketch 7 Sketches: the curves an outline is drawn with (lines, arcs, circles and ellipses; rectangles and polygons are drawn as lines).
cc_core::sketch_edit 13 Editing the curves of a sketch: where two curves (or the lines, circles and ellipses they lie on) cross, a curve trimmed or extended to a point, split in two, and offset alone or along the chain of curves joined to it.
cc_core::spline 21 Splines of sketches: a chain of cubic Bézier segments, kept as their control points p0 c1 c2 p1 c1 c2 p2 … (3n + 1 points for n segments).
cc_core::stair 19 Stairs: the plan shapes of a stair element, how its type is built (solid, cast in place, assembled) and the rules that size its steps (riser limits and Blondel’s formula 2 × riser + tread).
cc_core::steel_building 22 Parametric steel buildings: a host element that holds the parameters of a steel shed (span, eave height, roof slope and shape, bays, the types of its members, purlins and girts) and owns ordinary columns and beams made from them.
cc_core::structural_material 1 The structural material of a column or beam type: concrete, steel (rolled or cold-formed) or timber.
cc_core::structural_profile 16 Structural profiles: the cross-sections of columns, beams and framing members as named project objects (Project::profiles).
cc_core::sun 32 The sun of a view: where it stands in the sky for a date, a time and the project’s site, and the settings each view keeps to place it.
cc_core::sweep 8 Sweeps and blends of component pieces.
cc_core::template_spec 6 The sizes and names that differ between the metric and the imperial templates.
cc_core::title_block 28 Title blocks: components of kind ComponentKind::TitleBlock whose 2D pieces (ComponentDef::sheet) draw a whole sheet (border, title block, logo) in paper millimeters, origin at the paper’s bottom-left corner.
cc_core::topography 11 Terrain: a topography surface from measured points (x, y, z) inside a closed boundary drawn in plan.
cc_core::transform 1 Rigid transforms in plan (move, rotate, mirror) applied to elements.
cc_core::truss 21 Parametric trusses: a host element that holds the parameters of a plane truss (its span line, shape, height, web pattern, panels, member types and copies) and owns the ordinary beams (chords, diagonals) and columns (verticals) made from them, kept in step like a steel building’s (see crate::member_host).
cc_core::types 16  
cc_core::units 13 Project units: how lengths, areas, volumes, angles, slopes and money are displayed and typed.
cc_core::view 18  
cc_core::wall_framing 12 Light steel and wood framing of walls: a host element attached to one straight wall that owns ordinary columns (studs, king and jack studs, cripples) and beams (tracks or plates, headers, sills, blocking) laid out from its parameters, its wall and the doors and windows the wall hosts.
cc_core::wall_ops 7 Geometry edits of linear elements (walls, beams, grids): trim or extend to a corner or to a reference line, split, offset and align.

cc_core

crates/cc_core/src/lib.rs

Re-exports

cc_core::arc

crates/cc_core/src/arc.rs

Circular arcs in plan, described like polyline arcs by their two ends and a bulge: tan(sweep / 4), positive when the arc turns counter-clockwise from the start to the end, 0 for a straight line, ±1 for a half circle. A bulge is unchanged by moving, rotating or scaling the ends, and by a mirror that also swaps them.

Items: MAX_BULGE · Arc · segments · ARC_STEP

const MAX_BULGE

pub const MAX_BULGE: f64

Largest bulge accepted: a sweep of about 337°, short of a full circle.

struct Arc

pub struct Arc

A circular arc from start_angle turning by sweep radians (counter-clockwise when positive) around center.

Traits: Debug, Clone, Copy, PartialEq

Fields

Methods

fn segments

pub fn segments(angle: f64, max_step: f64) -> usize

Number of segments for a span of angle radians, each at most max_step.

const ARC_STEP

pub const ARC_STEP: f64

Default angular step for drawing and meshing arcs: 3°.

cc_core::bar_marks

crates/cc_core/src/bar_marks.rs

Bar marks: the names (N1, N2…) bending schedules and bar tags give the bars of reinforcement, one per bar shape: the same diameter, steel grade and shape (legs, radii, bends and hooks, within a length tolerance and ANGLE_TOLERANCE_DEG, read from either end or mirrored). Marks are derived (cc_geom::bar_marks resolves them, a pure function): a set’s bar_mark override names all its bars; otherwise a bar whose shape matches an entry of the frozen marks table (BarMarking::frozen, in table order) takes its mark; the shapes left are numbered on the fly with the prefix, after the highest frozen number (and from start), in a stable order: partition, then diameter descending, then length descending, then shape. So every bar has a mark, and frozen marks never shift when the model changes. Freezing writes the marks shown into the table; renumbering clears it and freezes a fresh numbering. The settings live in crate::Project::bar_marking (tracked as project settings) with the stock_length bars are bought in (bars longer than it need splices).

Items: DEFAULT_PREFIX · DEFAULT_START · MAX_START · DEFAULT_LENGTH_TOLERANCE · MIN_LENGTH_TOLERANCE · MAX_LENGTH_TOLERANCE · ANGLE_TOLERANCE_DEG · DEFAULT_STOCK_LENGTH · MAX_FROZEN · MAX_MARK_LEGS · MAX_MARK_LENGTH · MAX_MARK_TEXT · MIN_STOCK_LENGTH · MAX_STOCK_LENGTH · BarMarking · FrozenMark · MarkShape · MarkLeg · tolerance_ok · stock_length_ok

const DEFAULT_PREFIX

pub const DEFAULT_PREFIX: &str

Prefix of numbered marks when none is set.

const DEFAULT_START

pub const DEFAULT_START: u32

First number when none is set.

const MAX_START

pub const MAX_START: u32

Largest first number.

const DEFAULT_LENGTH_TOLERANCE

pub const DEFAULT_LENGTH_TOLERANCE: f64

Legs of two bars of one mark differ by at most this when none is set, meters.

const MIN_LENGTH_TOLERANCE

pub const MIN_LENGTH_TOLERANCE: f64

Smallest and largest length tolerance, meters.

const MAX_LENGTH_TOLERANCE

pub const MAX_LENGTH_TOLERANCE: f64

const ANGLE_TOLERANCE_DEG

pub const ANGLE_TOLERANCE_DEG: f64

Turns of two bars of one mark differ by at most this, degrees.

const DEFAULT_STOCK_LENGTH

pub const DEFAULT_STOCK_LENGTH: f64

Length bars are bought in when none is set, meters.

const MAX_FROZEN

pub const MAX_FROZEN: usize

Most entries of the frozen marks table.

const MAX_MARK_LEGS

pub const MAX_MARK_LEGS: usize

Most legs of a frozen shape (bars of more legs are numbered, not frozen).

const MAX_MARK_LENGTH

pub const MAX_MARK_LENGTH: f64

Longest leg or radius a frozen shape keeps, meters.

const MAX_MARK_TEXT

pub const MAX_MARK_TEXT: usize

Longest prefix or mark, in characters.

const MIN_STOCK_LENGTH

pub const MIN_STOCK_LENGTH: f64

Shortest and longest stock length, meters.

const MAX_STOCK_LENGTH

pub const MAX_STOCK_LENGTH: f64

struct BarMarking

pub struct BarMarking

How bars are marked: the numbering and the frozen marks table.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize, Default

Fields

Methods

struct FrozenMark

pub struct FrozenMark

A mark kept for one bar shape.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

struct MarkShape

pub struct MarkShape

A bar shape in a compact canonical form: open or closed, its legs in order (the orientation cc_geom::bar_marks picks among the readings from either end, mirrored and, for closed bars, from any corner).

Traits: Debug, Clone, PartialEq, Default, Serialize, Deserialize

Fields

Methods

struct MarkLeg

pub struct MarkLeg

One leg of a MarkShape: its length (meters), the radius of an arc leg, the turn along an arc and the bend after the leg (degrees, signed the way the bar first turns), and whether it is part of a hook.

Traits: Debug, Clone, Copy, PartialEq, Default, Serialize, Deserialize

Fields

fn tolerance_ok

pub fn tolerance_ok(v: f64) -> bool

Whether v is a usable length tolerance.

fn stock_length_ok

pub fn stock_length_ok(v: f64) -> bool

Whether v is a usable stock length.

cc_core::bar_tag

crates/cc_core/src/bar_tag.rs

Bar tags: annotations that write a reinforcement set’s bars in a plan, an elevation or a section — 25 N1 Ø12.5 c/12 C=500: the count, the mark, the diameter in millimeters, the spacing in centimeters (sets without one leave it out) and the length of one bar in centimeters (C=var when the set’s bars differ). A multiplier writes 2x first, for sets repeated on both faces. The text is derived each time (cc_views::bar_tags), from the set’s bars and marks. Like text notes, a tag lives in one view (view); it goes with that view and with its set.

Items: MAX_MULTIPLIER · DEFAULT_TEXT_SIZE · BarTagParts · BarTag · repair_type

const MAX_MULTIPLIER

pub const MAX_MULTIPLIER: u32

Largest multiplier.

const DEFAULT_TEXT_SIZE

pub const DEFAULT_TEXT_SIZE: f64

Text size of the default type, paper millimeters.

struct BarTagParts

pub struct BarTagParts

The parts of a tag’s text that are written.

Traits: Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default

Fields

struct BarTag

pub struct BarTag

A bar tag in a view.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

fn repair_type

pub fn repair_type(text_size: &mut f64) -> usize

Replace an invalid type text size; returns how many changed.

cc_core::bracing

crates/cc_core/src/bracing.rs

Parametric bracing: a host element that holds the parameters of the braces of one bay of a frame (the bay line between two column axes, the storey height, the number of storeys, the pattern and the brace type) and owns the ordinary beams made from them, kept in step like a truss’s (see crate::member_host). Local coordinates: x along start → end (the bay, L wide), heights above the level from base_offset, storey s between s · height and (s + 1) · height.

Items: LENGTH · HEIGHT · STORIES · BASE_OFFSET · DEFAULT_LENGTH · DEFAULT_HEIGHT · BracingPattern · BracingRole · BracingMember · Bracing · host_type

const LENGTH

pub const LENGTH: RangeInclusive<f64>

The bay width, column axis to column axis, meters.

const HEIGHT

pub const HEIGHT: RangeInclusive<f64>

One storey, meters.

const STORIES

pub const STORIES: RangeInclusive<u32>

const BASE_OFFSET

pub const BASE_OFFSET: RangeInclusive<f64>

The foot of the lowest storey above the level, meters.

const DEFAULT_LENGTH

pub const DEFAULT_LENGTH: f64

const DEFAULT_HEIGHT

pub const DEFAULT_HEIGHT: f64

enum BracingPattern

pub enum BracingPattern

How the braces cross a storey of the bay.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct BracingRole

pub struct BracingRole

A brace’s place: its storey (from the bottom) and its index in the pattern there.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize

Fields

Methods

struct BracingMember

pub struct BracingMember

A brace the bracing manages.

Traits: Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize

Fields

struct Bracing

pub struct Bracing

Traits: Debug, Clone, PartialEq, Serialize, Deserialize, MemberHost

Fields

Methods

fn host_type

pub fn host_type(id: ElementTypeId, name: String) -> ElementType

The type a project gets with its first bracing.

cc_core::browser

crates/cc_core/src/browser.rs

Project browser organization: named schemes that group the views of the project browser by view type, level, discipline or phase, in that order of nesting. The schemes and the one in use are project settings; with no scheme in use the browser lists the views by type alone. tree builds what the browser shows: at each depth the views that have a value for the criterion go into a group per value, and the others (a section has no level) go on to the next criterion beside those groups.

Items: MAX_SCHEMES · MAX_CRITERIA · MAX_NAME · DEFAULT_GROUPING · GroupBy · Discipline · BrowserScheme · BrowserOrganization · distinct · GroupKey · Node · label · tree

const MAX_SCHEMES

pub const MAX_SCHEMES: usize

Most schemes a project keeps.

const MAX_CRITERIA

pub const MAX_CRITERIA: usize

Most criteria a scheme nests.

const MAX_NAME

pub const MAX_NAME: usize

Longest scheme name, characters.

const DEFAULT_GROUPING

pub const DEFAULT_GROUPING: [GroupBy; 1]

The grouping of a project without a scheme in use: by view type.

enum GroupBy

pub enum GroupBy

What a level of the browser tree groups the views by.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize

Variants

Methods

enum Discipline

pub enum Discipline

The discipline a plan belongs to.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash

Variants

Methods

struct BrowserScheme

pub struct BrowserScheme

A named way to group the browser’s views.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

struct BrowserOrganization

pub struct BrowserOrganization

The project’s browser schemes and the one in use.

Traits: Debug, Clone, PartialEq, Default, Serialize, Deserialize

Fields

Methods

fn distinct

pub fn distinct(criteria: &[GroupBy]) -> Vec<GroupBy>

criteria without repeats, cut at MAX_CRITERIA.

enum GroupKey

pub enum GroupKey

What a group of the browser tree stands for.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash

Variants

Methods

enum Node

pub enum Node

A row of the browser tree.

Traits: Debug, Clone, PartialEq

Variants

Methods

fn label

pub fn label(view: &View) -> String

A view’s name in the browser: sheets go by number and name.

fn tree

pub fn tree(project: &Project, criteria: &[GroupBy]) -> Vec<Node>

The browser tree of project grouped by criteria, outermost first.

cc_core::cad

crates/cc_core/src/cad.rs

Imported CAD drawings (DWG and DXF underlays). A CadDrawing is the neutral form cc_cad reads both formats into: layers and flat primitives (blocks already inserted) in drawing units. Arcs stay arcs (centers and ends can be snapped to) and are tessellated only when drawn. A CadImport element places one drawing in one 2D view: units to meters, an extra scale, a rotation and an insertion point. The drawing is shared (Arc), so undo steps that change the placement or the layers do not copy it.

Items: MAX_PRIMS · MAX_POLY_POINTS · MAX_TEXT_CHARS · MAX_COORD · CadUnit · CadColorMode · CadLayer · CadHAlign · CadVAlign · CadPrim · on_paper · text_width · union · CadImage · MAX_IMAGES · CadDrawing · CadImport · CadSnapIndex · CadSnap · aci_color

const MAX_PRIMS

pub const MAX_PRIMS: usize

Most primitives one drawing may hold (after blocks are inserted).

const MAX_POLY_POINTS

pub const MAX_POLY_POINTS: usize

Most points of one polyline or fill.

const MAX_TEXT_CHARS

pub const MAX_TEXT_CHARS: usize

Longest text kept, in characters.

const MAX_COORD

pub const MAX_COORD: f64

Largest coordinate magnitude accepted, drawing units.

enum CadUnit

pub enum CadUnit

Units a drawing is drawn in.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

enum CadColorMode

pub enum CadColorMode

How an imported drawing is colored.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct CadLayer

pub struct CadLayer

A layer of the drawing.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

enum CadHAlign

pub enum CadHAlign

Horizontal alignment of a text at its position.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

enum CadVAlign

pub enum CadVAlign

Vertical alignment of a text at its position.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

enum CadPrim

pub enum CadPrim

A primitive of a drawing, in drawing units. layer indexes CadDrawing::layers; color is the entity’s own color (None: the layer’s).

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Variants

Methods

fn on_paper

pub fn on_paper(rgb: [u8; 3]) -> [u8; 3]

A file color as drawn on white paper: colors meant for a dark screen (white, yellow, cyan) darkened.

fn text_width

pub fn text_width(text: &str, height: f64) -> f64

Approximate width of a text line (the proportion used for notes).

fn union

pub fn union(a: Option<(DVec2, DVec2)>, b: Option<(DVec2, DVec2)>) -> Option<(DVec2, DVec2)>

Merge two optional boxes.

struct CadImage

pub struct CadImage

A raster image laid on the drawing: pixel (0, 0) is the top-left corner of the parallelogram origin + s·u + t·v (s, t in 0..1), whose bottom-left corner is origin, u running along the image’s width and v up its height (drawing units).

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

const MAX_IMAGES

pub const MAX_IMAGES: usize

Most images one drawing may hold.

struct CadDrawing

pub struct CadDrawing

A drawing read from a DWG, DXF, SVG or PDF file, or an imported picture.

Traits: Debug, Clone, PartialEq, Default, Serialize, Deserialize

Fields

Methods

struct CadImport

pub struct CadImport

A DWG or DXF drawing placed in one 2D view, in that view’s drawing coordinates (like text notes): drawing point p lands at position + R(rotation)·M·(p · units · scale), M mirroring across the drawing’s X axis when mirrored.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

struct CadSnapIndex

pub struct CadSnapIndex

Where a drawing’s primitives lie, to find those near a point without visiting them all: snapping asks on every pointer move, and imported drawings hold up to a million primitives. A uniform grid over the drawing’s extents; primitives spanning many cells are kept apart and checked on every query.

Traits: Debug, Clone, Default

Some fields are private.

Methods

struct CadSnap

pub struct CadSnap

Snap features of an imported drawing near a point, view coordinates.

Traits: Debug, Clone, Default, PartialEq

Fields

fn aci_color

pub fn aci_color(index: i64) -> [u8; 3]

RGB of an AutoCAD Color Index (the standard 256-entry palette: 1-9 the named colors, 10-249 hue/saturation steps, 250-255 greys); 0 and 256 (by block / by layer) and 7 come out black for white paper.

cc_core::callout

crates/cc_core/src/callout.rs

Crop regions and callouts. A view of the model drawn in 2D (a floor or ceiling plan, a section or an elevation) may have a crop: a rectangle in its own drawing coordinates (meters on the view plane) outside which nothing of the model is drawn. A callout is a mark in a parent view standing for a detail view of a region of it: the detail view keeps the parent’s kind (so it stays live with the model) and its crop is the callout’s rectangle, or the callout points to a drafting view and keeps its own rectangle. The callout lives on the detail view (crate::View::callout), so deleting that view removes its mark, and moving the mark is editing the detail view’s crop.

Items: MIN_CROP · MAX_CROP · MAX_CHAIN · CropBox · Callout

const MIN_CROP

pub const MIN_CROP: f64

Smallest side of a crop rectangle, meters.

const MAX_CROP

pub const MAX_CROP: f64

Largest coordinate of a crop rectangle, meters from the view’s origin.

const MAX_CHAIN

pub const MAX_CHAIN: usize

How many parent links Project::sync_callouts follows (details of details).

struct CropBox

pub struct CropBox

A rectangle in a view’s drawing coordinates, min below and left of max.

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize

Fields

Methods

struct Callout

pub struct Callout

A callout: the mark in parent standing for the view that holds it.

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize

Fields

cc_core::component

crates/cc_core/src/component.rs

Parametric components: user-defined objects (furniture, fixtures, casework…) whose solids are sized by named parameters. A ComponentDef lists numeric parameters and solid pieces. Each piece is a box, a cylinder, a plan outline extruded upwards, or a profile of lines and arcs drawn on the plan, front or side plane and extruded across it or revolved about an axis (crate::profile); its coordinates and sizes are crate::expr expressions over the parameters, in the component’s local frame: origin at the insertion point, X to the right, Y to the back, Z up, meters. A piece marked void is cut out of the solid pieces it overlaps. Types of the same component share the definition and differ in parameter values; parameters marked instance can be overridden per element. Pieces brought in from other tools (IFC import) may be fixed polyhedral meshes instead, and the definition then remembers the IFC class the object had, so it is written back as the same class. A script piece (ComponentShape::Script) is Lua source that returns other pieces; see crate::component_script.

Re-exports

Items: ComponentKind · ParamKind · ComponentParam · ComponentShape · ComponentItem · DetailLevels · ConnectorDirection · ComponentConnector · ResolvedConnector · WALL_THICKNESS · HostOpening · DoorOperation · WindowOperation · SymbolSegment · SymbolLine · ComponentDef · IfcClass · ComponentPart · PartError · ResolveCtx · replace_name · convex_hull · library · mep_library · device_library

enum ComponentKind

pub enum ComponentKind

What a component represents (used for IFC mapping and grouping).

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

enum ParamKind

pub enum ParamKind

Unit or kind of a parameter value.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct ComponentParam

pub struct ComponentParam

Traits: Debug, Clone, PartialEq, Default, Serialize, Deserialize

Fields

Methods

enum ComponentShape

pub enum ComponentShape

Geometry of a piece; every field is an expression.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Variants

Methods

struct ComponentItem

pub struct ComponentItem

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

struct DetailLevels

pub struct DetailLevels

The detail levels of the views a piece shows in.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize, Default

Fields

Methods

enum ConnectorDirection

pub enum ConnectorDirection

Which way a run leaves a connector, in the component’s frame.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct ComponentConnector

pub struct ComponentConnector

A point where a pipe or conduit connects to the component: a toilet has a water inlet and a sewer outlet, an outlet its electrical connection.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

struct ResolvedConnector

pub struct ResolvedConnector

A connector resolved in the component’s frame.

Traits: Debug, Clone, PartialEq

Fields

const WALL_THICKNESS

pub const WALL_THICKNESS: &str

Name of the host wall’s thickness in the expressions of door and window components (see crate::openings).

struct HostOpening

pub struct HostOpening

The opening a door or window component cuts in its host wall: width wide, centered on the component, height tall from the sill.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

enum DoorOperation

pub enum DoorOperation

How the leaves of a swing door open, after IFC’s door operation types: each leaf swings about a vertical hinge towards the side the door opens to, with the hand of WindowOperation (left is the start of the opening along the wall, swapped by the element’s hand flip).

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

enum WindowOperation

pub enum WindowOperation

How the panels of a window open, after IFC’s window panel operations: side-hung panels swing about a vertical hinge towards the side the window opens to (y of its frame). The hand is the hinge’s side seen looking that way (a door’s convention): left is the start of the opening along the wall (-x), swapped by the element’s hand flip.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

type alias SymbolSegment

pub type SymbolSegment = ((f64, f64), (f64, f64), SymbolLine)

A line of a window’s elevation symbol: its ends (x, z) and how it is drawn.

enum SymbolLine

pub enum SymbolLine

How a line of a window’s elevation symbol is drawn.

Traits: Debug, Clone, Copy, PartialEq, Eq

Variants

struct ComponentDef

pub struct ComponentDef

Traits: Debug, Clone, PartialEq, Default, Serialize, Deserialize

Fields

Methods

struct IfcClass

pub struct IfcClass

An IFC entity class with its predefined and object types.

Traits: Debug, Clone, PartialEq, Default, Serialize, Deserialize

Fields

struct ComponentPart

pub struct ComponentPart

A resolved piece: a prism of footprint between z0 and z1, in the component’s local frame. Meshes, profiles on the front and side planes and revolutions carry their faces, with the convex hull of the vertices as footprint and their height range.

Traits: Debug, Clone, PartialEq

Fields

enum PartError

pub enum PartError

Why a piece could not be resolved.

Traits: Debug, Clone, PartialEq, std::fmt::Display

Variants

struct ResolveCtx

pub struct ResolveCtx<'a>

What resolving reads besides the definition.

Traits: Default

Fields

fn replace_name

pub fn replace_name(text: &str, old: &str, new: &str) -> String

Replace whole-identifier occurrences of old in text (numbers such as 2e3 are left alone).

fn convex_hull

pub fn convex_hull(points: &[DVec2]) -> Vec<DVec2>

Convex hull of plan points (counter-clockwise; fewer than 3 points when degenerate).

fn library

pub fn library(n: &dyn Fn(&str) -> String) -> Vec<(String, String, ComponentDef)>

The default component library: (component name, type name, definition). Parameter names come from n (keys tpl-param-*), so expressions use the translated names; materials are the template’s.

fn mep_library

pub fn mep_library(n: &dyn Fn(&str) -> String) -> Vec<(String, String, ComponentDef)>

The building-services part of the default library: plumbing fixtures and electrical devices. Wall-mounted devices have their back on the insertion point and stand out towards -Y; their elevation is the instance’s base offset (the mounting height).

fn device_library

pub fn device_library(device: crate::DeviceKind, n: &dyn Fn(&str) -> String) -> Option<(String, String, ComponentDef)>

The built-in definition of a communications or lightning protection device, which a project gets with the first one placed: (component, type name, definition). Data outlets and racks hang on walls like the electrical devices (their back on the insertion point); an air terminal is a rod standing Height (an instance parameter) on a base plate; an earth electrode a rod driven Length down from its top. None for the other device kinds (see mep_library).

cc_core::component_file

crates/cc_core/src/component_file.rs

.ccomp component files: a component definition with all its types and the materials it uses, to share components between projects.

Items: COMPONENT_FORMAT_VERSION · ComponentFile · NestedComponent · ComponentFileType · ComponentFileError · extract · to_ron · from_ron · save · MAX_COMPONENT_BYTES · load · MAX_LIBRARY_FILES · scan · types_for

const COMPONENT_FORMAT_VERSION

pub const COMPONENT_FORMAT_VERSION: u32

Current .ccomp format version.

struct ComponentFile

pub struct ComponentFile

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

struct NestedComponent

pub struct NestedComponent

A detail component another one in the file nests.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

struct ComponentFileType

pub struct ComponentFileType

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

enum ComponentFileError

pub enum ComponentFileError

Traits: Debug, Error

Variants

fn extract

pub fn extract(project: &Project, component: &str) -> Result<ComponentFile, ComponentFileError>

Collect the component named component from project.

fn to_ron

pub fn to_ron(file: &ComponentFile) -> Result<String, ComponentFileError>

fn from_ron

pub fn from_ron(text: &str) -> Result<ComponentFile, ComponentFileError>

Parse and validate a component file.

fn save

pub fn save(file: &ComponentFile, path: &Path) -> Result<(), ComponentFileError>

const MAX_COMPONENT_BYTES

pub const MAX_COMPONENT_BYTES: u64

Largest .ccomp file read: imported meshes make the largest ones.

fn load

pub fn load(path: &Path) -> Result<ComponentFile, ComponentFileError>

const MAX_LIBRARY_FILES

pub const MAX_LIBRARY_FILES: usize

Most component files a library scan reads.

fn scan

pub fn scan(folders: &[std::path::PathBuf]) -> (Vec<(std::path::PathBuf, ComponentFile)>, Vec<(std::path::PathBuf, String)>)

The component files (.ccomp) in folders and their subfolders, sorted by path: the ones that load, and the paths of those that do not, with why. Bounded in depth and number of files; links to folders are not followed.

fn types_for

pub fn types_for(project: &Project, file: &ComponentFile, mut alloc: impl FnMut() -> u64) -> (Vec<ElementType>, Vec<Material>)

Types to add to project for file: the component and type names are made unique and missing materials are listed. Ids are allocated from alloc, so callers can add them inside a transaction.

cc_core::component_ref

crates/cc_core/src/component_ref.rs

Reference planes, reference lines and labeled dimensions of a component: the skeleton that parameters drive and pieces follow. A reference plane is a named plane square to one axis of the component’s frame, at a position given by an crate::expr expression. Its name can be used in any expression of the component (a piece’s coordinates, other planes, connectors), so a piece “locked” to a plane simply reads it: x = Right. Three origin planes are always there, at zero: CENTER_X (the plane x = 0, center left/right), CENTER_Y (y = 0, center front/back) and BASE (z = 0). A dimension between two parallel planes shows their distance in one of the component’s views. Labeling it with a parameter writes the second plane’s position as the first plus (or minus) the parameter, so changing the parameter moves the plane and whatever reads it. Everything stays an expression; there is no constraint solver.

Items: CENTER_X · CENTER_Y · BASE · ORIGIN_PLANES · MAX_REFS · PlaneAxis · RefPlane · RefLine · RefDimension · RefEqual · RefError · Scope · is_reserved_for

const CENTER_X

pub const CENTER_X: &str

The origin plane x = 0 (center left/right).

const CENTER_Y

pub const CENTER_Y: &str

The origin plane y = 0 (center front/back).

const BASE

pub const BASE: &str

The origin plane z = 0 (the base).

const ORIGIN_PLANES

pub const ORIGIN_PLANES: [(&str, PlaneAxis); 3]

The origin planes: name and axis.

const MAX_REFS

pub const MAX_REFS: usize

Most reference planes, lines and dimensions of a component.

enum PlaneAxis

pub enum PlaneAxis

The axis a reference plane is square to.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct RefPlane

pub struct RefPlane

A named plane square to axis at the position at (an expression).

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

struct RefLine

pub struct RefLine

A named line drawn on one of the sketch planes: the plane stands at offset along its normal axis, and the ends are (u, v) expressions in it (see SketchPlane). Revolution axes and angled references use it.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

struct RefDimension

pub struct RefDimension

A dimension between the parallel reference planes from and to, shown in view; label is the parameter that drives it, if any. place is where its line sits across the planes (meters, in the view’s other coordinate).

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

struct RefEqual

pub struct RefEqual

An equality (EQ): the plane middle stays halfway between the parallel planes a and b, shown in view as two equal dimensions at place. Its position is written (a + b) / 2 when the equality is made.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

enum RefError

pub enum RefError

Why a reference plane, line or dimension does not evaluate.

Traits: Debug, Clone, PartialEq, std::fmt::Display

Variants

struct Scope

pub struct Scope

Every name that expressions of the component read, with its value: the parameters (with overrides), extra names, the origin planes and the reference planes that evaluate, plus the planes that do not.

Traits: Debug, Clone, Default, PartialEq

Fields

Methods

fn is_reserved_for

pub fn is_reserved_for(kind: crate::component::ComponentKind, name: &str) -> bool

Whether name is reserved in a component of kind: the origin planes and a door’s wall thickness everywhere, the paper size (SheetWidth, SheetHeight) in title blocks.

cc_core::component_script

crates/cc_core/src/component_script.rs

Scripted component pieces: the model side. A crate::ComponentShape::Script piece holds Lua source that declares parameters and hotspots and returns ordinary pieces from its geometry function. Running Lua is not this crate’s business: resolving goes through a ScriptEval (the cc_script crate implements it), which gets the parameter values and returns the pieces, or an error and the last pieces that worked for the same owner. The parameters a script declares are copied into the definition’s params (marked from_script) and its hotspots into hotspots, so schedules, the properties palette, engine commands and files see them without running Lua.

Items: MAX_SCRIPT_LEN · MAX_CHOICES · MAX_TEXT_LEN · MAX_HOTSPOTS · ParamChoice · HotspotShape · Hotspot · parse_color · color_text · ScriptOwner · ScriptInput · ScriptResult · ScriptEval · NoScripts · truncate

const MAX_SCRIPT_LEN

pub const MAX_SCRIPT_LEN: usize

Longest script source kept (bytes); longer ones are emptied on load.

const MAX_CHOICES

pub const MAX_CHOICES: usize

Most choices of a choice parameter.

const MAX_TEXT_LEN

pub const MAX_TEXT_LEN: usize

Longest text value, label or choice key kept (bytes).

const MAX_HOTSPOTS

pub const MAX_HOTSPOTS: usize

Most hotspots of a definition.

struct ParamChoice

pub struct ParamChoice

One option of a choice parameter: a stable key and the label shown.

Traits: Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize

Fields

enum HotspotShape

pub enum HotspotShape

The marker drawn for a hotspot.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct Hotspot

pub struct Hotspot

A point of a component that its elements move with a grip; scripts read where it is. Positions are in the component’s frame (meters).

Traits: Debug, Clone, PartialEq, Default, Serialize, Deserialize

Fields

fn parse_color

pub fn parse_color(text: &str) -> Option<[u8; 4]>

Parse #RRGGBB or #RRGGBBAA (alpha last).

fn color_text

pub fn color_text(c: [u8; 4]) -> String

#RRGGBBAA.

struct ScriptOwner

pub struct ScriptOwner

Whose script result this is, for the last pieces that worked: the element’s type and the element (none for a type’s own preview).

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Default

Fields

struct ScriptInput

pub struct ScriptInput

What a script receives.

Traits: Debug, Clone, PartialEq, Default

Fields

struct ScriptResult

pub struct ScriptResult

A script’s pieces, or why there are none this time.

Traits: Debug, Clone, PartialEq, Default

Fields

trait ScriptEval

pub trait ScriptEval

Runs a piece’s script.

Implemented by (2): cc_core::component_script::NoScripts, cc_script::object::ScriptCache

Required and provided items

struct NoScripts

pub struct NoScripts

No runtime: every script fails.

Traits: ScriptEval

fn truncate

pub fn truncate(text: &mut String, max: usize) -> bool

Cut text to at most max bytes on a character boundary; whether it was cut.

cc_core::connection

crates/cc_core/src/connection.rs

Steel and timber connections: an element at one end of a column or beam (member, end) of a standard kind, whose plates and bolts cc_geom::connection derives from the member’s geometry on every build. It has no placement of its own: it is removed with its member (crate::EditCtx::remove_element), follows its phases and design option (crate::phase::phase_host), is never copied (Project::copy_set), and a member end carries at most one (Project::repair_connections keeps the lowest id).

Items: LENGTH · COUNT · ConnectionKind · MemberEnd · ConnectionParams · Connection · host_type

const LENGTH

pub const LENGTH: RangeInclusive<f64>

Every length of a connection, meters. A plate’s width and length may also be 0: taken from the member’s section plus edge.

const COUNT

pub const COUNT: RangeInclusive<u32>

Bolt rows and columns.

enum ConnectionKind

pub enum ConnectionKind

The standard joints.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Default, Serialize, Deserialize

Variants

Methods

enum MemberEnd

pub enum MemberEnd

Which end of its member a connection sits at.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize

Variants

Methods

struct ConnectionParams

pub struct ConnectionParams

The sizes of a connection, meters (see the kind for what each means).

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Default

Fields

Methods

struct Connection

pub struct Connection

A connection at one end of a column or beam.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

fn host_type

pub fn host_type(id: ElementTypeId, name: String) -> ElementType

The type a project gets with its first connection.

cc_core::curtain

crates/cc_core/src/curtain.rs

Curtain walls: walls made of a grid of panels and mullions. A wall type with a CurtainSystem (TypeData::Wall::curtain) is a curtain wall type: its walls are not layered bodies but a grid laid over the wall’s face, vertical lines spaced along the wall and horizontal lines up from its base, with a panel in each cell and mullions on the lines and around the border. Each wall may adjust its grid (CurtainEdits): its own lines instead of the type’s, segments of lines removed (the cells on both sides become one panel) and panels swapped. layout works out the grid of one wall in wall-local coordinates (u along the wall’s body centerline from its start, z absolute elevations); cc_geom::curtain places it in the world.

Items: MAX_LINES · MIN_SPACING · LINE_TOL · GridLayout · GridJustification · CurtainGrid · CurtainPanel · Mullion · CurtainSystem · GridAxis · GridSegment · PanelSwap · CurtainEdits · MAX_TEXT · to_text · from_text · PanelCell · MullionPiece · Layout · layout

const MAX_LINES

pub const MAX_LINES: usize

Most grid lines on one axis of a wall (files are hostile input).

const MIN_SPACING

pub const MIN_SPACING: f64

Smallest spacing a layout uses, in meters.

const LINE_TOL

pub const LINE_TOL: f64

Positions within this distance are the same grid line.

enum GridLayout

pub enum GridLayout

How a grid spaces its lines over the length (or height) of a wall.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

enum GridJustification

pub enum GridJustification

Where a fixed-distance grid starts: the remainder goes to the other end (or half to each end, centered).

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct CurtainGrid

pub struct CurtainGrid

The lines of one direction of a curtain grid.

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Default

Fields

Methods

enum CurtainPanel

pub enum CurtainPanel

What fills a cell of the grid.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize, Default

Variants

Methods

struct Mullion

pub struct Mullion

A rectangular mullion section: width seen on the face of the wall, depth across it.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize, Default

Fields

struct CurtainSystem

pub struct CurtainSystem

The curtain grid of a wall type.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize, Default

Fields

Methods

enum GridAxis

pub enum GridAxis

A direction of the grid: vertical lines (spaced along the wall) or horizontal ones (spaced up it).

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize

Variants

struct GridSegment

pub struct GridSegment

A removed piece of an interior grid line: the line at at (u of a vertical line, height above the base of a horizontal one), between the two lines across it on both sides of along (a height for a vertical line, a u for a horizontal one).

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize

Fields

struct PanelSwap

pub struct PanelSwap

A panel other than the type’s, in the cell (or merged cells) holding the point u along the wall and z above its base.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

struct CurtainEdits

pub struct CurtainEdits

One wall’s adjustments to its type’s grid. Positions are wall-local: u along the body centerline from its start, heights above its base.

Traits: Debug, Clone, PartialEq, Default, Serialize, Deserialize

Fields

Methods

const MAX_TEXT

pub const MAX_TEXT: usize

Longest text from_text reads (files are hostile input).

fn to_text

pub fn to_text<T: Serialize>(value: &T) -> String

A curtain system or a wall’s edits as text (for exchange files, such as an IFC property). Component panels keep their type id, which only means something in the same project.

fn from_text

pub fn from_text<T: serde::de::DeserializeOwned>(text: &str) -> Option<T>

Read what to_text wrote; None when it is too long or not valid.

struct PanelCell

pub struct PanelCell

A cell, or cells merged where segments were removed, and its panel.

Traits: Debug, Clone, PartialEq

Fields

Methods

struct MullionPiece

pub struct MullionPiece

A straight piece of mullion: along a vertical line at at from span.0 to span.1 (heights), or along a horizontal line at height at from span.0 to span.1 (along the wall); offset is where its section’s center lies from the line, along the wall or up.

Traits: Debug, Clone, PartialEq

Fields

Methods

struct Layout

pub struct Layout

The grid of one curtain wall.

Traits: Debug, Clone, PartialEq, Default

Fields

Methods

fn layout

pub fn layout(system: &CurtainSystem, edits: &CurtainEdits, u: (f64, f64), base: f64, top: f64) -> Layout

The grid of a curtain wall of system, adjusted by edits, over u (along the body centerline, between the ends after joins) and from base to top (absolute elevations).

cc_core::design_option

crates/cc_core/src/design_option.rs

Design options: alternative sets of elements within one project. The project holds OptionSets (say “Entrance” or “Kitchen layout”), each with an ordered list of DesignOptions and one primary option. An element belongs to the main model (Element::design_option is None), shown with every option, or to exactly one option. A view shows the main model plus one option of each set: the one it chooses (View::design_options), else the option being edited when it belongs to that set (Project::active_option), else the set’s primary option (“automatic”). Elements of the other options are left out of the view altogether: drawings, schedules, joins and room boundaries. Hosted elements follow their hosts (a door is in its wall’s option, see Project::option_fixes); annotations belong to no option. Deleting an option deletes its elements; accepting a set’s primary option moves its elements into the main model and deletes the set with its other options and their elements. IFC export writes the main model and the primary options only.

Items: MAX_OPTION_SETS · MAX_OPTIONS · DesignOption · OptionSet

const MAX_OPTION_SETS

pub const MAX_OPTION_SETS: usize

Most option sets in a project.

const MAX_OPTIONS

pub const MAX_OPTIONS: usize

Most options in a set.

struct DesignOption

pub struct DesignOption

One alternative of an option set.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

struct OptionSet

pub struct OptionSet

A named group of mutually exclusive design options.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

cc_core::detail

crates/cc_core/src/detail.rs

Detail lines: view-specific 2D curves (lines, arcs, circles and whole or partial ellipses, the SketchCurve geometry) drawn in one view with a line style. Like text notes they live in their view’s drawing coordinates (meters), are owned by it (Element::owner_view) and go with it; they belong to no phase-dependent geometry, take no part in the model’s 3D or IFC, and are drawn in drafting views and on top of plans, ceiling plans, elevations, sections and legends. A polyline is drawn as one element per segment, so each segment is an ordinary curve that the sketch edits (crate::sketch_edit: trim, extend, split, offset) and grips change on its own. The line style is a LineStyleRef: one of the built-in DetailStyles or one of the project’s own line styles (LineStyleDef: a name, weight, color and dash pattern, kept in Project::line_styles and tracked as project settings). Region boundaries (crate::region) take the same references. A reference to a project style that no longer exists reads as the thin built-in style, and repair resets it.

Items: DetailLine · MAX_COORD · LineStyles · LineStyleRef · MAX_LINE_STYLES · MIN_WEIGHT_MM · MAX_WEIGHT_MM · LineStyleDef · DetailStyle

struct DetailLine

pub struct DetailLine

A detail line of one view.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

const MAX_COORD

pub const MAX_COORD: f64

Coordinates and sizes past this (meters) are refused (a crafted file).

type alias LineStyles

pub type LineStyles = BTreeMap<LineStyleId, LineStyleDef>

The project’s line styles, by id.

enum LineStyleRef

pub enum LineStyleRef

The style a detail line or a region’s boundary is drawn with.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize, Default

Variants

Methods

const MAX_LINE_STYLES

pub const MAX_LINE_STYLES: usize

Most project line styles (a crafted file).

const MIN_WEIGHT_MM

pub const MIN_WEIGHT_MM: f64

Range of a line style’s weight, paper millimeters.

const MAX_WEIGHT_MM

pub const MAX_WEIGHT_MM: f64

struct LineStyleDef

pub struct LineStyleDef

One of the project’s line styles: a name, a weight on paper, a color and a dash pattern. Names are unique and differ from the built-in codes, so commands can name either.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

enum DetailStyle

pub enum DetailStyle

The built-in line styles of detail lines.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

cc_core::detail_component

crates/cc_core/src/detail_component.rs

Detail components: reusable 2D components for construction details. A detail component is a component of kind ComponentKind::Detail (category DetailComponent, TypeData::Component) made only of 2D pieces, the same SheetItems title blocks are drawn with (ComponentDef::sheet): strokes of lines and arcs (open or closed, with a pen weight in paper millimeters, a color, a dash pattern, and a solid or pattern fill when closed), texts and pictures, plus SheetShape::Nested pieces that place another detail component inside this one. Unlike a title block’s, every length is in meters in the component’s own frame (text heights too), and expressions read the component’s parameters. An element of kind ElementKind::DetailComponent places a type in one view (view, like detail lines and text notes; removed with it): its origin at position in the view’s drawing coordinates, turned rotation_deg, sized by scale and, when mirrored, flipped across its own X axis before turning. It has no phase, no 3D and no IFC. Nested components are named by their component name and read the parameter values of that component’s first type; resolving them (walk) is bounded in depth, in visits and in drawn points, and a component met again inside itself is left out (a cycle).

Items: MIN_SCALE · MAX_SCALE · MAX_DEPTH · MAX_VISITS · MAX_POINTS · scale_ok · DetailComponent · Place · nested_names · Visit · walk · stroke_of · ring_stroke · def_of

const MIN_SCALE

pub const MIN_SCALE: f64

Range of a placement’s scale.

const MAX_SCALE

pub const MAX_SCALE: f64

const MAX_DEPTH

pub const MAX_DEPTH: usize

Deepest nesting followed (the element’s own component is depth 0).

const MAX_VISITS

pub const MAX_VISITS: usize

Most component resolutions one element’s drawing makes.

const MAX_POINTS

pub const MAX_POINTS: usize

Most points of strokes one element’s drawing draws in all.

fn scale_ok

pub fn scale_ok(s: f64) -> bool

Whether s is a usable scale.

struct DetailComponent

pub struct DetailComponent

A detail component placed in one view.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

struct Place

pub struct Place

A similarity of the plane: scale by scale, then the rigid t.

Traits: Debug, Clone, Copy, PartialEq, Default

Fields

Methods

fn nested_names

pub fn nested_names(def: &ComponentDef) -> impl Iterator<Item = &str>

The names of the components def nests directly.

struct Visit

pub struct Visit<'a>

What walk visits: each resolution’s pieces, where they go, and the nesting depth (0 for the element’s own component).

Fields

fn walk

pub fn walk<'d>(lookup: &dyn Fn(&str) -> Option<&'d ComponentDef>, name: &str, def: &ComponentDef, overrides: &BTreeMap<String, f64>, place: Place, visit: &mut dyn FnMut(Visit)) -> bool

Resolve def with overrides and visit its pieces through place, then each nested component’s (found by lookup), depth first. A component already being resolved (a cycle), nesting past MAX_DEPTH, more than MAX_VISITS resolutions or strokes past MAX_POINTS points are left out; returns whether everything was visited.

fn stroke_of

pub fn stroke_of(curve: &SketchCurve) -> Option<SheetShape>

A stroke piece that draws curve (in the component’s frame, meters): lines and arcs as two points (a longer arc three), circles and whole ellipses as closed strokes.

fn ring_stroke

pub fn ring_stroke(ring: &[DVec2]) -> Option<SheetShape>

A closed stroke along ring (straight sides).

fn def_of

pub fn def_of(pieces: Vec<SheetItem>) -> ComponentDef

A new detail component definition from pieces.

cc_core::dim_line

crates/cc_core/src/dim_line.rs

The dimension line of linear and aligned dimensions: lining it up with the lines of other dimensions, and chains of dimensions that share one line (continuous dimensioning). The line of a dimension with direction d (unit) is the set of points x with x · n = a · n + offset, where n = d.perp() (the left of d).

Items: PARALLEL_SIN · extent · offset_through · LineAlignment · align · chain · ordinate

const PARALLEL_SIN

pub const PARALLEL_SIN: f64

Largest sine of the angle between two dimension lines that still counts as parallel (about 0.06°).

fn extent

pub fn extent(dim: &Dimension) -> Option<(DVec2, DVec2)>

The drawn extent of a linear or aligned dimension’s line: where the witness lines of a and b meet it. None for other kinds or a degenerate direction.

fn offset_through

pub fn offset_through(dim: &Dimension, p: DVec2) -> Option<f64>

The offset (from dim.a, left of its direction positive) that puts the line of dim through p.

struct LineAlignment

pub struct LineAlignment

The line of dim lined up with another dimension’s.

Traits: Debug, Clone, Copy, PartialEq

Fields

fn align

pub fn align<'a>(dim: &Dimension, others: impl IntoIterator<Item = &'a Dimension>, tol: f64) -> Option<LineAlignment>

Snap the line of dim (a linear or aligned dimension being placed, at its current offset) onto the line of a parallel dimension of others when it lies within tol (model units) of it. The nearest line wins; None when no parallel line is close enough.

fn chain

pub fn chain(view: ViewId, points: &[DVec2], dir: DVec2, offset: f64, aligned: bool) -> Option<Vec<Dimension>>

The dimensions of a chain through points measured along dir, all on the line at offset from the first point (left of dir positive): one dimension from each point to the next. With aligned, a segment along dir (or against it) is an aligned dimension, so it keeps following the direction of what it measures; any other segment (and every segment without aligned) is a linear dimension along dir. None when dir is degenerate, a value is not finite, or a segment measures nothing along dir (shorter than 1e-6).

fn ordinate

pub fn ordinate(view: ViewId, points: &[DVec2], dir: DVec2, offset: f64) -> Option<Vec<Dimension>>

The running (ordinate) dimensions from the origin points[0] to each other point, measured along dir, all on the line at offset from the origin (left of dir positive). None when dir is degenerate, a value is not finite, or a point measures nothing from the origin along dir (closer than 1e-6).

cc_core::dim_refs

crates/cc_core/src/dim_refs.rs

Associative dimensions: each end of a dimension may reference a point of an element (stored in that element’s own frame, plus a height in elevations and sections) or a level. Every edit ends by recomputing referenced ends (crate::EditCtx), inside the same transaction, so dimensions follow moved, rotated, stretched or raised elements and levels, and undo restores both together.

Items: DimRef · RefTarget · RefAnchor · RefHeight · Projection

struct DimRef

pub struct DimRef

What a dimension end follows.

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize

Fields

Methods

enum RefTarget

pub enum RefTarget

Traits: Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize

Variants

enum RefAnchor

pub enum RefAnchor

Where the point sits in the element’s frame.

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize

Variants

struct RefHeight

pub struct RefHeight

Height of a referenced point: dz above the element’s base, or above its top when from_top (walls), so it follows height changes.

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize

Fields

struct Projection

pub struct Projection

How elevations and sections map the model: x along right from origin (plan), y the height.

Traits: Debug, Clone, Copy, PartialEq

Fields

Methods

cc_core::dim_style

crates/cc_core/src/dim_style.rs

How a dimension type draws its dimensions: the marks at the ends of the dimension line, the witness lines, the pens and the text around the value. Sizes are paper millimeters, so they read the same at any scale.

Items: MAX_LENGTH_MM · MIN_MARK_MM · MAX_AFFIX · DimensionStyle

const MAX_LENGTH_MM

pub const MAX_LENGTH_MM: f64

Most paper millimeters any length of the style may take.

const MIN_MARK_MM

pub const MIN_MARK_MM: f64

Smallest mark.

const MAX_AFFIX

pub const MAX_AFFIX: usize

Most characters of the prefix or the suffix.

struct DimensionStyle

pub struct DimensionStyle

The drawing parameters of a dimension type. Every field has a default, so types saved before them draw as they did.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize, Default

Fields

Methods

cc_core::document

crates/cc_core/src/document.rs

Items: Transaction · EditCtx · Document

struct Transaction

pub struct Transaction

A recorded, reversible set of changes.

Traits: Debug, Clone, Default

Fields

Some fields are private.

Methods

struct EditCtx

pub struct EditCtx<'a>

Mutable access to a project inside Document::edit; records the original state of everything it touches.

Some fields are private.

Methods

struct Document

pub struct Document

An open project plus its undo history and file state. Cloned to run a long command (an import) on another thread while the app keeps drawing.

Traits: Clone

Fields

Some fields are private.

Methods

cc_core::element

crates/cc_core/src/element.rs

Items: Element · ElementKind · WallTop · LocationLine · Wall · Hosted · Floor · Ceiling · RoofShape · Roof · Room · Grid · TextNote · Leader · LeaderSymbol · Dimension · DimensionKind · Column · BeamLateral · BeamVertical · Beam · FoundationShape · Foundation · BarFace · WallSide · SpacingZone · BarEnd · RebarLayout · FaceBars · Splice · Rebar · ShapedRebar · Stair · Ramp · Railing · Component

struct Element

pub struct Element

A model element instance. Coordinates are in meters; X east, Y north, Z up.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

enum ElementKind

pub enum ElementKind

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Variants

Methods

enum WallTop

pub enum WallTop

How the top of a wall is defined.

Traits: Debug, Clone, Copy, PartialEq, Default, Serialize, Deserialize

Variants

enum LocationLine

pub enum LocationLine

Which line of the wall the drawn start-end line follows.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct Wall

pub struct Wall

Traits: Debug, Clone, PartialEq, Serialize, Deserialize, Default

Fields

Methods

struct Hosted

pub struct Hosted

A door or window hosted by a wall.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

struct Floor

pub struct Floor

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

struct Ceiling

pub struct Ceiling

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

enum RoofShape

pub enum RoofShape

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize

Variants

struct Roof

pub struct Roof

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

struct Room

pub struct Room

A room: the space enclosed by room-bounding walls around position. Its boundary is derived from the walls (see cc_geom).

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

struct Grid

pub struct Grid

A named grid line (datum), shown in every plan, and in the elevations and sections it runs square to.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

struct TextNote

pub struct TextNote

A text note in one view, in that view’s drawing coordinates (like dimensions), optionally with leaders pointing at what it describes.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

struct Leader

pub struct Leader

A leader line from a text to what it points at: one segment, or two when it has an elbow (text → elbow → end).

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize

Fields

enum LeaderSymbol

pub enum LeaderSymbol

The mark at the end of a leader.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct Dimension

pub struct Dimension

A dimension in one view, in that view’s drawing coordinates. What a, b and offset mean depends on the DimensionKind.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

enum DimensionKind

pub enum DimensionKind

How a dimension measures.

Traits: Debug, Clone, Copy, PartialEq, Default, Serialize, Deserialize

Variants

struct Column

pub struct Column

A column placed at a point, from its base to its top constraint.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

enum BeamLateral

pub enum BeamLateral

Which line across a beam’s section its start-end location line follows.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

enum BeamVertical

pub enum BeamVertical

Which height of a beam’s section sits at its location elevation.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct Beam

pub struct Beam

A horizontal beam between two points. Its location line is at the level elevation plus top_offset; vertical picks which height of the section sits there (the top by default) and lateral which line across it.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

enum FoundationShape

pub enum FoundationShape

Where a foundation is in plan.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Variants

Methods

struct Foundation

pub struct Foundation

A foundation: its top is top_offset above the level; the type gives its size and depth.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

enum BarFace

pub enum BarFace

Where a set of longitudinal bars lies in its host’s section.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

enum WallSide

pub enum WallSide

The face of a wall a layer of bars lies near: its exterior (left) face or its interior (right) one.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct SpacingZone

pub struct SpacingZone

The spacing of a wall’s horizontal bars up to a height above its base; the last zone of a set runs to the top of the wall.

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize

Fields

struct BarEnd

pub struct BarEnd

How an end of a wall’s vertical bar is bent: across the wall (towards the outside of its own face when positive, towards the other face when negative; 0 for a straight end), then along (back beside the bar when positive, on past its end when negative; 0 for none). An L hook has only across; a bar turned into the slab and up again has both.

Traits: Debug, Clone, Copy, PartialEq, Default, Serialize, Deserialize

Fields

Methods

enum RebarLayout

pub enum RebarLayout

How a set of bars is laid out in its host.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Variants

Methods

struct FaceBars

pub struct FaceBars

The longitudinal bars on one face of a column’s section: count of them evenly spread, the two at the face’s ends (the corners, shared with the faces beside it) included, so at least 2; or with a count of 0 as many as keep them at most spacing apart.

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize

Fields

Methods

struct Splice

pub struct Splice

Lap splices: a bar longer than max_length (the stock length) is made of pieces overlapping by lap, the splices of neighbouring bars staggered.

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize

Fields

Methods

struct Rebar

pub struct Rebar

A set of reinforcing bars in a beam, column, wall or slab (host), cover from its faces; the type gives the bar diameter. The bars follow their host.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

struct ShapedRebar

pub struct ShapedRebar

Reinforcing bars of any shape (bars bent to a schedule’s shape codes, read from IFC files): each bar is its center line, in plan x/y and z above the element’s level (meters), closed when its ends meet; the type gives the diameter. Unlike Rebar they have no host and keep their place.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

struct Stair

pub struct Stair

A stair starting at start (bottom of the first riser, center of the width) going up along direction_deg; layout gives its plan shape.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

struct Ramp

pub struct Ramp

A ramp starting at start (the middle of its foot) going up along direction_deg; layout gives its plan shape and slope.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

struct Railing

pub struct Railing

A railing along an open path.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

struct Component

pub struct Component

A placed parametric component (see crate::component).

Traits: Debug, Clone, PartialEq, Default, Serialize, Deserialize

Fields

cc_core::element::slab_bars

crates/cc_core/src/element.rs

Limits of slab reinforcement.

Items: MAX_RADIAL · MAX_TRIM · MAX_LENGTH

const MAX_RADIAL

pub const MAX_RADIAL: u32

Most radial bars of one set.

const MAX_TRIM

pub const MAX_TRIM: u32

Most trimming bars along one side of an opening.

const MAX_LENGTH

pub const MAX_LENGTH: f64

Longest anchorage, hook or start radius, meters.

cc_core::element::wall_bars

crates/cc_core/src/element.rs

Limits of wall reinforcement.

Items: MIN_SPACING · MAX_ZONES · MAX_EVERY · HOOK_ANGLES · default_hooks

const MIN_SPACING

pub const MIN_SPACING: f64

Least spacing of bars, meters.

const MAX_ZONES

pub const MAX_ZONES: usize

Most spacing zones of one set of horizontal bars.

const MAX_EVERY

pub const MAX_EVERY: u32

Ties are placed at most every this many bars.

const HOOK_ANGLES

pub const HOOK_ANGLES: std::ops::RangeInclusive<f64>

The angles a tie’s hooks may be bent by, degrees.

fn default_hooks

pub fn default_hooks() -> [f64; 2]

The hooks of a tie when none are given: 135 degrees at both ends.

cc_core::expr

crates/cc_core/src/expr.rs

Arithmetic expressions over named parameters, used by component geometry: numbers, parameter names, + - * / ^, parentheses, unary minus and the functions min, max, abs, sqrt, round, floor, ceil, sin, cos, tan (degrees). Errors are values, never panics; nesting depth and input length are bounded.

Items: MAX_LEN · ExprError · eval · names · is_ident_char · is_valid_name

const MAX_LEN

pub const MAX_LEN: usize

Longest expression text accepted, in bytes.

enum ExprError

pub enum ExprError

Traits: Debug, Clone, PartialEq, Eq, std::fmt::Display, std::error::Error

Variants

fn eval

pub fn eval(text: &str, lookup: &dyn Fn(&str) -> Option<f64>) -> Result<f64, ExprError>

Evaluate text, resolving names with lookup.

fn names

pub fn names(text: &str) -> Vec<String>

Names referenced by text (for dependency checks and renames).

fn is_ident_char

pub fn is_ident_char(c: char) -> bool

Characters allowed in parameter names (letters of any script, digits, _).

fn is_valid_name

pub fn is_valid_name(name: &str) -> bool

Whether name can be used as a parameter name.

cc_core::fill_pattern

crates/cc_core/src/fill_pattern.rs

The project’s own fill patterns (hatches): families of parallel, possibly dashed lines, as in the plain-text .pat format CAD programs share (see crate::pat). Materials, filled region types and view overrides refer to one with Pattern::Custom. Lengths are millimeters: on paper for drafting patterns, which keep their printed size at any view scale, and in the real world for model patterns (tiles, brick courses), which scale with the view. A pattern’s scale multiplies every length.

Items: MAX_FILL_PATTERNS · MAX_FAMILIES · MAX_DASHES · MAX_NAME · MAX_DESCRIPTION · MIN_OFFSET · MIN_PERIOD · MAX_LENGTH · MIN_SCALE · MAX_SCALE · FillPatternKind · PatternLine · FillPattern · FillPatterns · PatternSlot · visit_fill · visit_material · visit_type · visit_override · visit_view_graphics · visit_phase_graphics · PatternUsage

const MAX_FILL_PATTERNS

pub const MAX_FILL_PATTERNS: usize

Most custom patterns in a project (a crafted file).

const MAX_FAMILIES

pub const MAX_FAMILIES: usize

Most line families in one pattern.

const MAX_DASHES

pub const MAX_DASHES: usize

Most dash values in one family.

const MAX_NAME

pub const MAX_NAME: usize

Longest pattern name, characters.

const MAX_DESCRIPTION

pub const MAX_DESCRIPTION: usize

Longest description, characters.

const MIN_OFFSET

pub const MIN_OFFSET: f64

Smallest distance between the lines of a family, millimeters (before the scale).

const MIN_PERIOD

pub const MIN_PERIOD: f64

Shortest repeat of a dash list, millimeters (before the scale).

const MAX_LENGTH

pub const MAX_LENGTH: f64

Largest length or coordinate, millimeters.

const MIN_SCALE

pub const MIN_SCALE: f64

Range of a pattern’s scale.

const MAX_SCALE

pub const MAX_SCALE: f64

enum FillPatternKind

pub enum FillPatternKind

How a pattern’s lengths are read.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct PatternLine

pub struct PatternLine

One family of parallel lines.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

struct FillPattern

pub struct FillPattern

A custom fill pattern.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

type alias FillPatterns

pub type FillPatterns = BTreeMap<FillPatternId, FillPattern>

The project’s fill patterns, by id.

enum PatternSlot

pub enum PatternSlot<'a>

A place that holds a pattern: a fill’s own (where Pattern::None means nothing is drawn) or a view override’s (where None keeps what the view draws).

Variants

Methods

fn visit_fill

pub fn visit_fill(f: &mut PatternFill, v: &mut dyn FnMut(PatternSlot))

Visits every pattern of a fill.

fn visit_material

pub fn visit_material(m: &mut Material, v: &mut dyn FnMut(PatternSlot))

Visits the patterns of a material (surface and cut).

fn visit_type

pub fn visit_type(t: &mut TypeData, v: &mut dyn FnMut(PatternSlot))

Visits the patterns of a type: a filled region’s fill, the hatches of a component’s 2D pieces.

fn visit_override

pub fn visit_override(o: &mut GraphicOverride, v: &mut dyn FnMut(PatternSlot))

Visits the fill patterns of an override.

fn visit_view_graphics

pub fn visit_view_graphics(g: &mut ViewGraphics, v: &mut dyn FnMut(PatternSlot))

Visits the patterns of a view’s (or template’s) graphics.

fn visit_phase_graphics

pub fn visit_phase_graphics(g: &mut PhaseGraphics, v: &mut dyn FnMut(PatternSlot))

Visits the patterns of the phase graphics.

struct PatternUsage

pub struct PatternUsage

What uses a custom pattern.

Traits: Debug, Clone, Default, PartialEq

Fields

Methods

cc_core::graph_binding

crates/cc_core/src/graph_binding.rs

Elements made by visual programming graphs. A graph (cc_engine::graph) run creates elements through engine commands; each one is bound to the call that made it, so the next run changes it in place instead of adding another. Bindings live in crate::Project::graph_bindings, keyed by element, and are tracked by undo like the other project settings; removing an element drops its binding, and copies of an element are never bound.

Items: MAX_PATH · GraphBinding

const MAX_PATH

pub const MAX_PATH: usize

Deepest lacing path kept (list nesting of a graph value).

struct GraphBinding

pub struct GraphBinding

The call of a graph node that made an element.

Traits: Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize

Fields

Methods

cc_core::graphics

crates/cc_core/src/graphics.rs

View graphics: what a view shows and how it draws it. Each view holds a ViewGraphics: per-category visibility and graphic overrides, the view filters applied to it (in order) and per-element overrides and hidden elements. The project holds the named ViewFilters (categories plus rules on parameters) and the ViewTemplates (sets of view properties a view can follow). Overrides combine attribute by attribute: an element’s own override beats the filters, the first matching filter beats later ones, and the filters beat the element’s phase status overrides (see crate::phase), which beat the category. An element is hidden when it is hidden in the view, its category is hidden, or any matching filter hides it.

Items: LinePattern · LineGraphics · FillGraphics · GraphicOverride · CategoryGraphics · FilterUse · ViewGraphics · FilterOp · FilterParam · FilterRule · ViewFilter · TemplateIncludes · ViewTemplate · TemporaryVisibility

enum LinePattern

pub enum LinePattern

Dash pattern of a line.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Default, Serialize, Deserialize

Variants

Methods

struct LineGraphics

pub struct LineGraphics

Overrides of a kind of line; None keeps what the view draws.

Traits: Debug, Clone, Copy, PartialEq, Default, Serialize, Deserialize

Fields

Methods

struct FillGraphics

pub struct FillGraphics

Overrides of a kind of fill; None keeps what the view draws.

Traits: Debug, Clone, Copy, PartialEq, Default, Serialize, Deserialize

Fields

Methods

struct GraphicOverride

pub struct GraphicOverride

Graphic overrides of a category, filter or element in a view. Cut graphics apply where the view plane cuts the element (plans, sections), projection and surface graphics to what is seen beyond it.

Traits: Debug, Clone, Copy, PartialEq, Default, Serialize, Deserialize

Fields

Methods

struct CategoryGraphics

pub struct CategoryGraphics

Visibility and overrides of a category in a view.

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Default

Fields

Methods

struct FilterUse

pub struct FilterUse

A filter applied to a view: elements it matches are hidden or drawn with its overrides.

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize

Fields

Methods

struct ViewGraphics

pub struct ViewGraphics

What a view shows and how: category visibility and overrides, applied filters, and element overrides and hidden elements.

Traits: Debug, Clone, PartialEq, Default, Serialize, Deserialize

Fields

Methods

enum FilterOp

pub enum FilterOp

How a rule compares an element’s parameter with its value.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize

Variants

Methods

enum FilterParam

pub enum FilterParam

A parameter a filter rule tests: any schedule field, or the element’s base elevation.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize

Variants

Methods

struct FilterRule

pub struct FilterRule

One test of a filter.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

struct ViewFilter

pub struct ViewFilter

A named, project-wide selection of elements by category and rules.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

struct TemplateIncludes

pub struct TemplateIncludes

The view properties a template controls.

Traits: Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default

Fields

struct ViewTemplate

pub struct ViewTemplate

Named view properties views can copy or follow.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

struct TemporaryVisibility

pub struct TemporaryVisibility

Elements hidden or isolated for a while in a view (not part of the model: not saved and not undone).

Traits: Debug, Clone, PartialEq, Default, Serialize, Deserialize

Fields

Methods

cc_core::grid

crates/cc_core/src/grid.rs

Grid naming and alignment. Naming. A new grid continues the series of the grids parallel to it (within SERIES_DEG): the name after that of the most recently placed parallel grid (successor: 1 → 2, 09 → 10, A → B, Z → AA, A1 → A2, 1.1 → 1.2). A grid with no parallel grid starts a new series: numbers for the first series, letters for a series across a numbered one (and numbers across a lettered one). The name is then made unique among the existing grids by stepping the series on. Alignment. The bubble lines of a grid are the lines through its ends perpendicular to it. align_end snaps a grid end being drawn or dragged onto the bubble line of a parallel grid’s end (keeping the grid parallel to it), and aligned_ends gives a grid the extents of a parallel reference grid.

Items: SERIES_DEG · PARALLEL_DEG · is_parallel · successor · next_name · EndAlignment · align_end · aligned_ends

const SERIES_DEG

pub const SERIES_DEG: f64

Grids whose directions differ by at most this many degrees (either way along the line) belong to the same series when naming.

const PARALLEL_DEG

pub const PARALLEL_DEG: f64

Grids whose directions differ by at most this many degrees are parallel when aligning ends.

fn is_parallel

pub fn is_parallel(u: DVec2, v: DVec2, deg: f64) -> bool

Whether the lines along u and v are within deg degrees of each other, either way along the line. Degenerate directions are not parallel.

fn successor

pub fn successor(name: &str) -> Option<String>

The name after name in its series: the trailing number counts up keeping its zero padding (A1 → A2, 1.9 → 1.10, 09 → 10), or the trailing letters (up to three, all upper or all lower case) count like spreadsheet columns (A → B, Z → AA, AZ → BA, b → c). None when the name does not end in a counter (North, Sul, A').

fn next_name

pub fn next_name<'a>(grids: impl IntoIterator<Item = (ElementId, &'a Grid)>, start: DVec2, end: DVec2) -> String

Name for a new grid from start to end among grids (see the module documentation): it continues the series of the most recently placed (highest id) parallel grid and is unique among grids.

struct EndAlignment

pub struct EndAlignment

A grid end snapped onto the bubble line of another grid’s end.

Traits: Debug, Clone, Copy, PartialEq

Fields

fn align_end

pub fn align_end(others: &[(DVec2, DVec2)], fixed: Option<DVec2>, raw: DVec2, tol: f64) -> Option<EndAlignment>

Snap a grid end near raw to the bubble lines of the grids others (start and end points), within tol (model units):

fn aligned_ends

pub fn aligned_ends(grid: &Grid, reference: &Grid, start: bool, end: bool) -> Option<(DVec2, DVec2)>

New (start, end) of grid with the extents of the parallel grid reference: each end moves along the grid’s own line onto the bubble line of the reference end on its side (start/end pick which ends move). None when the grids are not parallel (within PARALLEL_DEG) or the result would be shorter than 1 cm.

cc_core::ids

crates/cc_core/src/ids.rs

Items: Uid

struct Uid

pub struct Uid(pub u128)

Globally unique, persistent identifier of a model object (128 bits), kept across saves so exports such as IFC keep stable ids. Zero means “not assigned yet”.

Traits: Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default, fmt::Display, Serialize, Deserialize<'de>

Methods

cc_core::level_mark

crates/cc_core/src/level_mark.rs

Level marks: annotations that write the elevation of a point in a plan, an elevation or a section — the finished level above a shelf line and the raw (structural) level under it. Plans draw a circle with two filled quarters on the point; elevations and sections a triangle pointing down to it. Like text notes, a mark lives in one view (view). The levels are measured from the model (see cc_geom::level_mark) unless the mark sets them; the type adds its datum (the value written for the project’s zero, e.g. 100.00) and the suffixes after each value.

Items: LevelMark · MAX_LEVEL · DEFAULT_TEXT_SIZE · default_type · repair_type

struct LevelMark

pub struct LevelMark

A level mark in a view.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

const MAX_LEVEL

pub const MAX_LEVEL: f64

Largest level a mark writes either way from zero, meters (datum included).

const DEFAULT_TEXT_SIZE

pub const DEFAULT_TEXT_SIZE: f64

Text size of the default type, paper millimeters.

fn default_type

pub fn default_type(name: &dyn Fn(&str) -> String) -> crate::TypeData

The type a project gets with its first level mark, with the suffixes name gives the keys tpl-level-mark-finished and tpl-level-mark-raw (in the interface language).

fn repair_type

pub fn repair_type(text_size: &mut f64, datum: &mut f64) -> usize

Replace invalid type values; returns how many changed.

cc_core::lightning

crates/cc_core/src/lightning.rs

Lightning protection: the conductors of a lightning protection system (on the roof, down the walls and in the ground) and the protection classes the coverage check uses. Air terminals and earth electrodes are components (devices of the DeviceKind::AirTerminal and DeviceKind::EarthElectrode kinds); conductors are runs like pipes (MepSegment), of a conductor type that gives their diameter and material.

Items: ConductorRole · LightningConductor · EARTH_DEPTH · EARTH_RING_DISTANCE · MIN_CONDUCTOR_DIAMETER · MAX_CONDUCTOR_DIAMETER · LpsClass · protected_reach

enum ConductorRole

pub enum ConductorRole

What a lightning protection conductor does.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct LightningConductor

pub struct LightningConductor

A conductor of a lightning protection system: a straight run (on a roof, down a wall or in the ground) with its role.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

const EARTH_DEPTH

pub const EARTH_DEPTH: f64

Depth of an earth ring and of the top of earth electrodes below the level, meters (the usual minimum burial depth).

const EARTH_RING_DISTANCE

pub const EARTH_RING_DISTANCE: f64

Usual distance of an earth ring from the building’s walls, meters.

const MIN_CONDUCTOR_DIAMETER

pub const MIN_CONDUCTOR_DIAMETER: f64

Smallest and largest conductor diameter, meters (values outside are cut in files).

const MAX_CONDUCTOR_DIAMETER

pub const MAX_CONDUCTOR_DIAMETER: f64

enum LpsClass

pub enum LpsClass

Class of a lightning protection system (I is the most demanding). It sets the rolling sphere radius and the mesh width of the air termination, as in the public tables of the lightning protection standards.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

fn protected_reach

pub fn protected_reach(tip: f64, height: f64, radius: f64) -> Option<f64>

Horizontal reach of the protected volume of an air termination point at tip above a reference plane, at height above that plane, for a rolling sphere of radius: the protected volume of a single rod (the sphere resting on the plane and touching the rod). None when the point is above what the rod protects.

cc_core::mass

crates/cc_core/src/mass.rs

Conceptual masses: volumes for massing studies. A mass is a base outline in plan extruded height up from its level (plus base_offset), or lofted to a different top outline. Mass floors cut it at the levels it lists: each gives the floor outline at that level, with its area and perimeter, for gross floor areas before any wall or floor is drawn.

Items: MAX_OUTLINE · Mass · MassFloor · area · perimeter · MassFace · push_edge

const MAX_OUTLINE

pub const MAX_OUTLINE: usize

Largest outline a mass keeps (points).

struct Mass

pub struct Mass

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

struct MassFloor

pub struct MassFloor

A mass floor: the outline of a mass at a level, its area and perimeter.

Traits: Debug, Clone, PartialEq

Fields

fn area

pub fn area(poly: &[DVec2]) -> f64

Area of a closed polygon (either winding).

fn perimeter

pub fn perimeter(poly: &[DVec2]) -> f64

Perimeter of a closed polygon.

enum MassFace

pub enum MassFace

A face of a mass, for push/pull.

Traits: Debug, Clone, Copy, PartialEq, Eq

Variants

fn push_edge

pub fn push_edge(outline: &[DVec2], i: usize, d: f64) -> Option<Vec<DVec2>>

outline with edge i (from point i to the next) moved d outward, the edges beside it keeping their directions (they stretch or shrink). None for a bad edge or when the outline would fold over.

cc_core::material

crates/cc_core/src/material.rs

Materials: identity data, graphics in views (shading, transparency, surface and cut patterns), render appearance and physical properties. Types refer to materials by name.

Items: MaterialClass · Pattern · PatternFill · MaterialIdentity · MaterialGraphics · Finish · MAX_TEXTURE_BYTES · MAX_TEXTURE_PIXELS · MIN_TEXTURE_SIZE · MAX_TEXTURE_SIZE · MaterialTexture · MaterialAppearance · Behavior · MaterialPhysical · Material · template_properties

enum MaterialClass

pub enum MaterialClass

Broad family of a material (filters, defaults and IFC categories).

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

enum Pattern

pub enum Pattern

Fill pattern drawn on surfaces (elevations) or cuts (plans, sections).

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct PatternFill

pub struct PatternFill

A pattern over an optional background pattern, each with its color.

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Default

Fields

Methods

struct MaterialIdentity

pub struct MaterialIdentity

Descriptive and product data.

Traits: Debug, Clone, PartialEq, Default, Serialize, Deserialize

Fields

struct MaterialGraphics

pub struct MaterialGraphics

How the material looks in views.

Traits: Debug, Clone, PartialEq, Default, Serialize, Deserialize

Fields

enum Finish

pub enum Finish

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

const MAX_TEXTURE_BYTES

pub const MAX_TEXTURE_BYTES: usize

Largest texture image file kept, bytes.

const MAX_TEXTURE_PIXELS

pub const MAX_TEXTURE_PIXELS: u64

Most pixels a texture image may have (width × height).

const MIN_TEXTURE_SIZE

pub const MIN_TEXTURE_SIZE: f64

Smallest and largest real-world size of one repeat of a texture, meters.

const MAX_TEXTURE_SIZE

pub const MAX_TEXTURE_SIZE: f64

struct MaterialTexture

pub struct MaterialTexture

An image laid on a material’s surfaces in the textures style: one repeat covers width × height meters, moved by offset and turned by rotation_deg in the face’s plane coordinates (see Self::map).

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

struct MaterialAppearance

pub struct MaterialAppearance

Render appearance.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize, Default

Fields

enum Behavior

pub enum Behavior

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct MaterialPhysical

pub struct MaterialPhysical

Physical properties (SI units); None when unknown.

Traits: Debug, Clone, PartialEq, Default, Serialize, Deserialize

Fields

Methods

struct Material

pub struct Material

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

fn template_properties

pub fn template_properties(m: &mut Material, class: MaterialClass)

Template data for a default material: class, cut pattern and physical values.

cc_core::member_host

crates/cc_core/src/member_host.rs

Member hosts: elements with no geometry of their own (steel buildings, trusses, bracings, wall framings) that own ordinary columns and beams laid out from their parameters. Every edit keeps them in step (crate::EditCtx runs crate::EditCtx::sync_member_hosts): a changed host rewrites its members in place, keeping their ids while their roles exist; a member the user edited or deleted is detached, and the host leaves its role alone from then on. Each host keeps its own typed roles; the shared code sees them as RoleKeys, whose order is the typed roles’ order.

Items: RoleKey · MemberHost · within · reset · fix_type

struct RoleKey

pub struct RoleKey(pub u64)

A member’s role as the shared code sees it: kind, group (frame, copy) and index packed so that the order is the typed role’s.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord

Methods

trait MemberHost

pub trait MemberHost

A host of members: what the shared sync and repair need from it.

Implemented by (4): cc_core::bracing::Bracing, cc_core::steel_building::SteelBuilding, cc_core::truss::Truss, cc_core::wall_framing::WallFraming

Required and provided items

fn within

pub(crate) fn within(name: &str, v: f64, range: &RangeInclusive<f64>) -> Result<(), String>

Whether v is a finite number in range (else an error naming it).

fn reset

pub(crate) fn reset(v: &mut f64, range: &RangeInclusive<f64>, default: f64) -> usize

Reset v to default when it is out of range; returns 1 when it did.

fn fix_type

pub(crate) fn fix_type(p: &Project, slot: &mut ElementTypeId, category: Category) -> Option<usize>

slot if it is a type of category, else the category’s default type (Some(1): one repair); None when there is none.

cc_core::mep

crates/cc_core/src/mep.rs

Building services (MEP): plumbing, electrical, structured cabling and lightning protection systems, the pipe, conduit and cable tray segments that run them, the valves on pipes, and the data that makes a component a plumbing fixture or an electrical, communications or lightning protection device. A system (a water supply, a drain, an electrical circuit, the cabling of a rack, a lightning protection system) is a project setting; pipes, conduits, conductors and components refer to it by SystemId. Defaults follow common Brazilian practice (fixture units and supply weights as in the public tables of the drainage and water supply standards; outlet mounting heights as usual in electrical plans).

Items: SystemKind · SystemClass · MepSystem · MepSegment · TrayStyle · TRAY_RUNG_SPACING · MAX_TRAY_WIDTH · MAX_TRAY_HEIGHT · ValveKind · Valve · DeviceKind · MAX_PORTS · MepData · CABLE_SLACK · MAX_LINK_LENGTH · cable_length

enum SystemKind

pub enum SystemKind

What a system carries.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

enum SystemClass

pub enum SystemClass

The families of systems: which elements each takes.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash

Variants

Methods

struct MepSystem

pub struct MepSystem

A plumbing system or an electrical circuit.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

struct MepSegment

pub struct MepSegment

A straight pipe or conduit run between two points, each at its own elevation above the level: horizontal, sloped, or vertical (a riser, when both ends share the plan position).

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

enum TrayStyle

pub enum TrayStyle

How a cable tray is built; it picks the 3D shape and the plan drawing.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

const TRAY_RUNG_SPACING

pub const TRAY_RUNG_SPACING: f64

Distance between the rungs of a ladder tray, meters.

const MAX_TRAY_WIDTH

pub const MAX_TRAY_WIDTH: f64

Widest and tallest cable tray section, meters (larger values in files are cut down).

const MAX_TRAY_HEIGHT

pub const MAX_TRAY_HEIGHT: f64

enum ValveKind

pub enum ValveKind

What a valve does; it picks the plan symbol and the IFC predefined type.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct Valve

pub struct Valve

A valve on a pipe: an inline accessory at meters along its host’s run (true length from the start), of the pipe’s diameter. It moves, is copied and is deleted with its pipe.

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize

Fields

Methods

enum DeviceKind

pub enum DeviceKind

What an electrical device is; it picks the plan symbol and the IFC class.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

const MAX_PORTS

pub const MAX_PORTS: u32

Most jacks on one data outlet (larger values in files are cut down).

enum MepData

pub enum MepData

Building-services data of a component definition.

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize

Variants

Methods

const CABLE_SLACK

pub const CABLE_SLACK: f64

Allowance added to each horizontal cable for the slack left at the rack and at the outlet, meters.

pub const MAX_LINK_LENGTH: f64

Longest horizontal cable (permanent link) of structured cabling, meters, as in the usual cabling standards.

fn cable_length

pub fn cable_length(outlet: DVec3, rack: DVec3, ceiling: f64) -> f64

The estimated route of a horizontal cable from an outlet at outlet to a rack at rack (world points): up from the outlet to ceiling (the world height of the outlet’s ceiling, where the pathways run), across in plan along the two axes, and down (or up) to the rack, plus CABLE_SLACK.

cc_core::openings

crates/cc_core/src/openings.rs

Doors and windows as components: the built-in definitions that the template’s door and window types use and that older files’ door and window types become. A door or window component (ComponentKind::Door or Window, with a HostOpening) is placed in a wall: its frame has x along the wall from the opening’s center, y across the wall from its location line (positive on the side a door opens to) and z up from the sill; its expressions may use WALL_THICKNESS, the host wall’s thickness.

Items: FRAME · STILE · BOTTOM_RAIL · OpeningNames · door_def · operable_door_def · french_door_def · window_def · niche_def · NICHE_MIN_BACK · operable_window_def

const FRAME

pub const FRAME: f64

Width of frame members (jambs, head, sash rails), meters.

const STILE

pub const STILE: f64

Width of the stiles and top rail of a glazed door’s leaves, meters.

const BOTTOM_RAIL

pub const BOTTOM_RAIL: f64

Height of a French door’s bottom rail (the solid lower part of each leaf), meters.

struct OpeningNames

pub struct OpeningNames

Names of the built-in parameters and pieces, in the project’s language.

Traits: Debug, Clone, Default

Fields

Methods

fn door_def

pub fn door_def(names: &OpeningNames, width: f64, height: f64, material: &str) -> ComponentDef

A swing door: two jambs and a head as deep as the wall, and a leaf of material in the middle of the wall.

fn operable_door_def

pub fn operable_door_def(names: &OpeningNames, (width, height): (f64, f64), material: &str, operation: DoorOperation) -> ComponentDef

A swing door whose leaves open as operation says: door_def with, for a double door, two leaves meeting in the middle.

fn french_door_def

pub fn french_door_def(names: &OpeningNames, (width, height, bottom_rail): (f64, f64, f64), (leaf_material, glass): (&str, &str), operation: DoorOperation) -> ComponentDef

A French door: a glazed swing door from the floor, whose leaves (one or two, as operation says) are stiles and a top rail of leaf_material around a pane of glass, over a solid bottom rail bottom_rail tall (the OpeningNames::bottom_rail parameter), in a frame as deep as the wall.

fn window_def

pub fn window_def(names: &OpeningNames, width: f64, height: f64, sill: f64, material: &str) -> ComponentDef

A window: a sash frame in the middle of the wall around a pane of material, and a sill board across the wall under it.

fn niche_def

pub fn niche_def(names: &OpeningNames, (width, height, depth, sill): (f64, f64, f64, f64)) -> ComponentDef

A niche: a recess width wide, height tall and depth deep in one face of its wall, its bottom sill above the wall’s base. It has no pieces: the wall shows inside it (pieces of a niche component are not placed yet).

const NICHE_MIN_BACK

pub const NICHE_MIN_BACK: f64

The least a niche leaves of its wall behind it, meters: a deeper one stops there (an opening through the wall is a door or a window).

fn operable_window_def

pub fn operable_window_def(names: &OpeningNames, (width, height, sill): (f64, f64, f64), material: &str, operation: WindowOperation) -> ComponentDef

A window whose panels open as operation says: window_def with, for two side-hung panels, a stile where they meet and a pane in each, and for sliding ones two panels on either side of the wall’s middle, overlapping by a stile.

cc_core::pad

crates/cc_core/src/pad.rs

Building pads: a flat area at an elevation, graded into the terrain that hosts it, with cut and fill slopes running out from its edges to the existing ground. The terrain’s surface becomes the graded one (cc_geom::pad); the pad itself has no solid. A pad lives on its terrain’s level (kept equal by every edit, see crate::EditCtx), is deleted with it and moves with it.

Items: MAX_OUTLINE · MIN_SLOPE · MAX_SLOPE · DEFAULT_CUT_SLOPE · DEFAULT_FILL_SLOPE · Pad · slope_ok · clamp_slope

const MAX_OUTLINE

pub const MAX_OUTLINE: usize

Most points of a pad’s outline.

const MIN_SLOPE

pub const MIN_SLOPE: f64

Gentlest and steepest slope ratios (horizontal run per unit of rise).

const MAX_SLOPE

pub const MAX_SLOPE: f64

const DEFAULT_CUT_SLOPE

pub const DEFAULT_CUT_SLOPE: f64

Ratios of a new pad type’s cut and fill slopes.

const DEFAULT_FILL_SLOPE

pub const DEFAULT_FILL_SLOPE: f64

struct Pad

pub struct Pad

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

fn slope_ok

pub fn slope_ok(r: f64) -> bool

Whether r is a slope ratio a pad keeps.

fn clamp_slope

pub fn clamp_slope(r: f64, default: f64) -> f64

r brought into the slope range (default when not a number).

cc_core::paint

crates/cc_core/src/paint.rs

Painted faces: a material laid on one surface of an element, over the material its type gives it (a painted wall face, a tiled floor top). The geometry is derived and rebuilt after every edit, so a paint does not hold a face index. It keeps what identifies the face from outside: a point on it and its outward normal, in model coordinates. After a rebuild the paint goes on the element’s face (of its body, framing left out) whose normal is within NORMAL_TOLERANCE_DEG of the stored one and that passes nearest the stored point, and from there on the faces of the element in the same plane (a wall face split by its openings) and, for a curved surface, the smooth facets joined to it (see cc_geom::paint). Moving, rotating or mirroring the element in plan moves the point and turns the normal with it; other edits (a longer wall, a thicker layer) keep the paint on the face that is still nearest. A face turned beyond the tolerance leaves the paint unshown until it is painted again.

Items: MAX_PAINTS · NORMAL_TOLERANCE_DEG · FacePaint · repair

const MAX_PAINTS

pub const MAX_PAINTS: usize

Most paints an element keeps.

const NORMAL_TOLERANCE_DEG

pub const NORMAL_TOLERANCE_DEG: f64

How far a face may have turned and still take its paint, degrees.

struct FacePaint

pub struct FacePaint

A material painted on one surface of an element.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

fn repair

pub fn repair(paints: &mut Vec<FacePaint>, material_exists: &dyn Fn(&str) -> bool) -> usize

Drop paints with bad numbers, of materials that are gone, and past the limit; returns how many went. Normals are made unit length first.

cc_core::pat

crates/cc_core/src/pat.rs

The plain-text .pat hatch pattern format many CAD programs read and write, as publicly described:

;%UNITS=MM
*NAME, optional description
;%TYPE=MODEL
angle, x-origin, y-origin, delta-x, delta-y [, dash1, dash2, ...]
```rust
A header line starting with `*` opens a pattern; each following line is
a family of parallel lines through the origin at the angle (degrees),
the next line shifted by delta-x along it and delta-y across it, with
optional dashes (positive drawn, negative gaps, zero dots). Text after
`;` is a comment; the comments `;%UNITS=MM|INCH` and
`;%TYPE=MODEL|DRAFTING` are read as markers (a type marker before the
first header sets the file's default, one inside a pattern that
pattern's kind). Parsing is bounded: file size, line length, patterns,
families and dashes.

**Items:** [`MAX_PAT_BYTES`](#cc_core-pat-max_pat_bytes) · [`MAX_PAT_PATTERNS`](#cc_core-pat-max_pat_patterns) · [`MAX_LINE_CHARS`](#cc_core-pat-max_line_chars) · [`MM_PER_INCH`](#cc_core-pat-mm_per_inch) · [`PatUnits`](#cc_core-pat-patunits) · [`PatOptions`](#cc_core-pat-patoptions) · [`PatError`](#cc_core-pat-paterror) · [`ParsedPat`](#cc_core-pat-parsedpat) · [`parse`](#cc_core-pat-parse) · [`write`](#cc_core-pat-write)

<a id="cc_core-pat-max_pat_bytes"></a>

### const `MAX_PAT_BYTES`

```rust
pub const MAX_PAT_BYTES: usize

Largest file read, bytes.

const MAX_PAT_PATTERNS

pub const MAX_PAT_PATTERNS: usize

Most patterns read from one file.

const MAX_LINE_CHARS

pub const MAX_LINE_CHARS: usize

Longest line read, characters.

const MM_PER_INCH

pub const MM_PER_INCH: f64

Millimeters in an inch.

enum PatUnits

pub enum PatUnits

The units a file’s lengths are in.

Traits: Debug, Clone, Copy, PartialEq, Eq, Default

Variants

struct PatOptions

pub struct PatOptions

How a file is read.

Traits: Debug, Clone, Copy, PartialEq, Default

Fields

struct PatError

pub struct PatError

A problem with a line of the file.

Traits: Debug, Clone, PartialEq

Fields

struct ParsedPat

pub struct ParsedPat

What a file holds: the patterns read (ids 0, millimeters) and the problems found; a pattern with a problem is left out.

Traits: Debug, Clone, Default, PartialEq

Fields

fn parse

pub fn parse(text: &str, options: &PatOptions) -> ParsedPat

Read .pat text.

fn write

pub fn write(patterns: &[FillPattern]) -> String

patterns as .pat text in millimeters, their scales applied.

cc_core::persist

crates/cc_core/src/persist.rs

.ccad project files: a versioned RON document.

Items: FORMAT_VERSION · MAX_FILE_BYTES · PersistError · to_ron · from_ron · from_ron_with_repairs · from_ron_with_repairs_localized · save · read_to_string_limited · load · load_with_repairs · load_with_repairs_localized

const FORMAT_VERSION

pub const FORMAT_VERSION: u32

Current file format version. Bump when the schema changes incompatibly. 28: the ANSI and architectural sheet sizes, and the slope unit RisePer12 (6:12), which older builds cannot read.

const MAX_FILE_BYTES

pub const MAX_FILE_BYTES: u64

Largest project file read, bytes (pictures and textures are kept in it).

enum PersistError

pub enum PersistError

Traits: Debug, Error

Variants

fn to_ron

pub fn to_ron(project: &Project) -> Result<String, PersistError>

fn from_ron

pub fn from_ron(text: &str) -> Result<Project, PersistError>

fn from_ron_with_repairs

pub fn from_ron_with_repairs(text: &str) -> Result<(Project, usize), PersistError>

Parse a project and repair invalid data (see Project::repair); also returns how many repairs were needed.

fn from_ron_with_repairs_localized

pub fn from_ron_with_repairs_localized(text: &str, translate: &dyn Fn(&str) -> Option<String>) -> Result<(Project, usize), PersistError>

Like from_ron_with_repairs, naming what migration adds with translate (template keys; Portuguese defaults when it gives none).

fn save

pub fn save(project: &Project, path: &Path) -> Result<(), PersistError>

fn read_to_string_limited

pub fn read_to_string_limited(path: &Path, max: u64) -> std::io::Result<String>

The text of the file at path, refused past max bytes before it is read (an I/O error of kind FileTooLarge): files are hostile input, and one far larger than any real file would only exhaust memory.

fn load

pub fn load(path: &Path) -> Result<Project, PersistError>

fn load_with_repairs

pub fn load_with_repairs(path: &Path) -> Result<(Project, usize), PersistError>

fn load_with_repairs_localized

pub fn load_with_repairs_localized(path: &Path, translate: &dyn Fn(&str) -> Option<String>) -> Result<(Project, usize), PersistError>

Like load_with_repairs, naming what migration adds with translate (see from_ron_with_repairs_localized).

cc_core::phase

crates/cc_core/src/phase.rs

Construction phases (renovation work). The project holds an ordered list of Phases (the template has “Existing” and “New Construction”). Every model element is created in a phase and may be demolished in the same or a later one. Each model view shows the model as of one phase, through a PhaseFilter: relative to the view’s phase an element is

Items: Phase · PhaseStatus · PhaseState · PhaseDisplay · PhaseFilter · PhaseGraphics · phase_graphics_is_default · TEMPLATE_FILTERS · TEMPLATE_PHASES · phase_host

struct Phase

pub struct Phase

A construction phase. The project keeps them in time order.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

enum PhaseStatus

pub enum PhaseStatus

An element’s status relative to a view’s phase.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize

Variants

Methods

enum PhaseState

pub enum PhaseState

Where an element stands in a view’s phase.

Traits: Debug, Clone, Copy, PartialEq, Eq

Variants

enum PhaseDisplay

pub enum PhaseDisplay

How a phase filter shows elements of one status.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct PhaseFilter

pub struct PhaseFilter

A named rule for which statuses a view shows, and how.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

struct PhaseGraphics

pub struct PhaseGraphics

Graphic overrides of each status (used where a filter says “Overridden”).

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Default

Fields

Methods

fn phase_graphics_is_default

pub(crate) fn phase_graphics_is_default(g: &PhaseGraphics) -> bool

const TEMPLATE_FILTERS

pub const TEMPLATE_FILTERS: [(&str, [PhaseDisplay; 4]); 7]

The template’s phase filters: name key and displays of existing, demolished, new and temporary elements.

const TEMPLATE_PHASES

pub const TEMPLATE_PHASES: [&str; 2]

The template’s phases (name keys), in order.

fn phase_host

pub fn phase_host(e: &Element) -> Option<ElementId>

The element that decides an element’s phases: the wall of a door or window, the beam or column of a rebar set, the stair of a railing, the wall of a wall framing, the member of a connection, the cap of a pile.

cc_core::pile

crates/cc_core/src/pile.rs

Piles and pile caps. A pile (Pile, ElementKind::Pile, category Pile) is a vertical shaft in the ground at a plan position: its head (cut_off) and its toe (toe) are offsets from its level, its embedment how far the head enters the cap above it; its type (TypeData::Pile) gives the section (PileSection), the kind (PileKind) and the material. The length is derived: cut_off - toe. A pile cap is a foundation (ElementKind::Foundation placed by a FoundationShape::Pad: position and rotation) whose type is of FoundationKind::PileCap: the type’s PileCap gives the layout of its piles, their spacing and edge distance, their type, length and embedment; its thickness is the cap’s. The cap’s outline follows from the layout (PileCap::outline), in the cap’s frame: the origin at its position, u along its rotation and v to the left of it. The piles of a cap are elements pointing at it (Pile::cap, with their index in the layout). Every edit keeps them in step with the cap and its type (see crate::EditCtx): piles are added or removed when the layout’s count changes, and each one stands where the layout puts it through the cap’s placement, on the cap’s level, its head at the cap’s bottom plus the embedment, its toe the pile length below. They are deleted, moved and copied with the cap; moved alone they go back. A pile whose cap is gone (or is no pile cap) is dropped, like a building pad without its terrain.

Items: MAX_PILES · MIN_PILE_SIZE · MAX_PILE_SIZE · MIN_PILE_LENGTH · MAX_PILE_LENGTH · MAX_OFFSET · MAX_EMBEDMENT · MIN_SPACING · MAX_SPACING · MIN_EDGE_DISTANCE · MAX_EDGE_DISTANCE · MIN_CIRCLE_RADIUS · MAX_CIRCLE_RADIUS · DEFAULT_DIAMETER · DEFAULT_PILE_LENGTH · DEFAULT_EMBEDMENT · DEFAULT_CAP_THICKNESS · PileKind · PileSection · PileCapRef · Pile · length_ok · PileLayout · CapOutline · PileCap · cap_of_type · cap_placement · CapPlacement · PileSync

const MAX_PILES

pub const MAX_PILES: u32

Most piles under one cap.

const MIN_PILE_SIZE

pub const MIN_PILE_SIZE: f64

Smallest and largest pile diameter (or square side), meters.

const MAX_PILE_SIZE

pub const MAX_PILE_SIZE: f64

const MIN_PILE_LENGTH

pub const MIN_PILE_LENGTH: f64

Shortest and longest pile, meters.

const MAX_PILE_LENGTH

pub const MAX_PILE_LENGTH: f64

const MAX_OFFSET

pub const MAX_OFFSET: f64

Largest offset of a pile’s head or toe from its level, meters.

const MAX_EMBEDMENT

pub const MAX_EMBEDMENT: f64

Deepest embedment of a pile’s head into its cap, meters.

const MIN_SPACING

pub const MIN_SPACING: f64

Closest and widest pile spacing in a cap (center to center), meters.

const MAX_SPACING

pub const MAX_SPACING: f64

const MIN_EDGE_DISTANCE

pub const MIN_EDGE_DISTANCE: f64

Smallest and largest edge distance (pile center to cap edge), meters.

const MAX_EDGE_DISTANCE

pub const MAX_EDGE_DISTANCE: f64

const MIN_CIRCLE_RADIUS

pub const MIN_CIRCLE_RADIUS: f64

Smallest and largest radius of a circle of piles, meters.

const MAX_CIRCLE_RADIUS

pub const MAX_CIRCLE_RADIUS: f64

const DEFAULT_DIAMETER

pub const DEFAULT_DIAMETER: f64

Defaults of a new pile type and pile cap type.

const DEFAULT_PILE_LENGTH

pub const DEFAULT_PILE_LENGTH: f64

const DEFAULT_EMBEDMENT

pub const DEFAULT_EMBEDMENT: f64

const DEFAULT_CAP_THICKNESS

pub const DEFAULT_CAP_THICKNESS: f64

enum PileKind

pub enum PileKind

How a pile is made.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

enum PileSection

pub enum PileSection

A pile’s cross-section, centered on its axis.

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Default

Variants

Methods

struct PileCapRef

pub struct PileCapRef

The cap a pile belongs to and its place in the cap’s layout.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize

Fields

struct Pile

pub struct Pile

A pile (see the module documentation).

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

fn length_ok

pub fn length_ok(length: f64) -> bool

Whether length is a pile length within the limits.

enum PileLayout

pub enum PileLayout

Where the piles of a cap stand, in the cap’s frame (spacing is the distance between neighbors, except on a circle).

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize

Variants

Methods

enum CapOutline

pub enum CapOutline

The plan of a pile cap in its frame.

Traits: Debug, Clone, PartialEq

Variants

Methods

struct PileCap

pub struct PileCap

What a pile cap type holds besides its thickness and material: its piles.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize, Default

Fields

Methods

fn cap_of_type

pub fn cap_of_type(data: &TypeData) -> Option<(&PileCap, f64)>

The pile cap a foundation type describes, with the cap’s thickness.

fn cap_placement

pub fn cap_placement(e: &Element) -> Option<(DVec2, f64, f64)>

A pile cap element’s placement: position, rotation (degrees) and top above its level.

struct CapPlacement

pub struct CapPlacement<'a>

A pile cap element as the sync and the geometry see it.

Traits: Debug, Clone, PartialEq

Fields

Methods

struct PileSync

pub(crate) struct PileSync

The changes that bring piles in step with their caps.

Traits: Debug, Default

Fields

cc_core::profile

crates/cc_core/src/profile.rs

Profiles of component pieces: closed outlines of straight segments, arcs and parts of ellipses drawn on one of the component’s planes (plan, front or side), with every coordinate an crate::expr expression, and the solids made from them: an extrusion across the plane or a revolution about an axis in it. A profile’s plane is placed at offset along the axis normal to it (Z for the plan, Y for the front, X for the side), and an extrusion runs depth from there along that axis. The solids come out as closed meshes with outward faces, in the component’s frame (X to the right, Y to the back, Z up).

Items: SketchPlane · ProfilePoint · ProfileBezier · ProfileEllipse · Segment · vertices · segment_points · ProfileError · outline · extrude · revolve · from_curves · to_curves · written

enum SketchPlane

pub enum SketchPlane

The plane a profile is drawn on, as seen in the matching view.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct ProfilePoint

pub struct ProfilePoint

A vertex of a profile. The segment to the next vertex is straight, an arc of radius when it is not empty (a positive radius bulges to the right of the direction of travel, outwards in a counter-clockwise profile; a negative one to the left), a part of ellipse, or a cubic Bézier curve by its two bezier handles (a spline’s segment).

Traits: Debug, Clone, PartialEq, Default, Serialize, Deserialize

Fields

Methods

struct ProfileBezier

pub struct ProfileBezier

The two handles of a cubic Bézier segment from a profile’s vertex to the next: (u1, v1) leaving the vertex, (u2, v2) arriving at the next.

Traits: Debug, Clone, PartialEq, Default, Serialize, Deserialize

Fields

struct ProfileEllipse

pub struct ProfileEllipse

The ellipse a profile segment runs along, from its vertex to the next: center (u, v), semi-axes rx and ry along its own axes, turned rotation degrees; counter-clockwise unless clockwise. The vertices should lie on it (each is taken at the ellipse’s parameter of its direction from the center).

Traits: Debug, Clone, PartialEq, Default, Serialize, Deserialize

Fields

enum Segment

pub enum Segment

The segment from a profile’s vertex to the next, in numbers.

Traits: Debug, Clone, Copy, PartialEq

Variants

fn vertices

pub fn vertices(points: &[ProfilePoint], lookup: &dyn Fn(&str) -> Option<f64>) -> Result<Vec<(DVec2, Segment)>, ProfileError>

The vertices of points and the segments from each to the next, in numbers.

fn segment_points

pub(crate) fn segment_points(a: DVec2, b: DVec2, segment: Segment, out: &mut Vec<DVec2>) -> Result<(), ProfileError>

The inner points of the segment from a to b.

enum ProfileError

pub enum ProfileError

Why a profile could not be resolved.

Traits: Debug, Clone, PartialEq, std::fmt::Display

Variants

fn outline

pub fn outline(points: &[ProfilePoint], lookup: &dyn Fn(&str) -> Option<f64>) -> Result<Vec<DVec2>, ProfileError>

The outline of points in plane coordinates, arcs divided into segments, counter-clockwise.

fn extrude

pub fn extrude(plane: SketchPlane, outline: &[DVec2], offset: f64, depth: f64) -> Vec<Vec<DVec3>>

The closed solid of a counter-clockwise outline on plane, from offset along the plane’s normal to offset + depth.

fn revolve

pub fn revolve(plane: SketchPlane, outline: &[DVec2], offset: f64, axis: f64, angle: f64) -> Result<Vec<Vec<DVec3>>, ProfileError>

The solid swept by a counter-clockwise outline on plane (placed offset along its normal) turning angle degrees about the line u = axis of the plane (parallel to V). The outline must lie on one side of the axis; it may touch it.

fn from_curves

pub fn from_curves(curves: &[SketchCurve], closed: bool) -> Result<Vec<(DVec2, Segment)>, SketchError>

The vertices and segments that draw the sketch curves: their one closed loop when closed, or else the open path they make (its last vertex ends it, with a straight segment that is not drawn). Arcs over half a turn split in two, circles and whole ellipses into halves.

fn to_curves

pub fn to_curves(vertices: &[(DVec2, Segment)], closed: bool) -> Vec<SketchCurve>

The sketch curves that draw vertices (the segment from the last vertex back to the first only when closed).

fn written

pub fn written(vertices: &[(DVec2, Segment)]) -> Vec<ProfilePoint>

Profile points that write vertices as plain numbers.

cc_core::profile_catalog

crates/cc_core/src/profile_catalog.rs

Built-in profile catalogs: the standard series of rolled, cold-formed, timber and hollow sections, as tables (cells split by ;, since the designations write decimals with a comma) compiled into the binary and parsed once. Each row is a designation (the full name the standard gives, e.g. W150x22,5 (H)) and the dimensions of the series’ ProfileShape in millimeters (taken from public dimension tables), plus the tabulated area in cm², kept only to check the computed outlines. Catalogs are not stored in projects: importing a row copies it in as a ProfileDef that remembers its CatalogRef.

Items: MAX_ROWS · Series · CatalogRow · catalog · series · row_to_def

const MAX_ROWS

pub const MAX_ROWS: usize

Most rows read from one table.

struct Series

pub struct Series

A catalog series: rows of one shape and material.

Traits: Debug, Clone, PartialEq

Fields

struct CatalogRow

pub struct CatalogRow

One row of a series.

Traits: Debug, Clone, PartialEq

Fields

fn catalog

pub fn catalog() -> &'static [Series]

Every built-in series, parsed on first use; rows that do not parse are left out.

fn series

pub fn series(code: &str) -> Option<&'static Series>

The series of that code.

fn row_to_def

pub fn row_to_def(series: &Series, row: &CatalogRow) -> Option<ProfileDef>

A profile for a row (id 0 and a new uid; the caller sets the id), named by its designation, or None when the row does not make a valid outline. Values the row lacks are 0, except a Z’s lip angle, which is square (90°).

cc_core::profile_sweep

crates/cc_core/src/profile_sweep.rs

Swept profiles: a closed profile, held by the element’s type, carried along a path drawn in plan at a height above the element’s level. They model what runs along walls, ceilings and roof edges: baseboards, crown moldings, fascia boards, gutters, copings. The profile is drawn in its own plane, square to the path: x across, positive to the left of the path walking along it (flip mirrors it to the right), and y up from the path’s height.

Items: MAX_PROFILE_POINTS · MAX_PROFILE_SIZE · MAX_PATH_POINTS · Sweep · ProfileProblem · check_profile · baseboard

const MAX_PROFILE_POINTS

pub const MAX_PROFILE_POINTS: usize

Most points of a profile.

const MAX_PROFILE_SIZE

pub const MAX_PROFILE_SIZE: f64

Largest extent of a profile, meters.

const MAX_PATH_POINTS

pub const MAX_PATH_POINTS: usize

Most points of a sweep’s path.

struct Sweep

pub struct Sweep

A swept profile element.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

enum ProfileProblem

pub enum ProfileProblem

Why a profile is refused.

Traits: Debug, Clone, Copy, PartialEq, Eq

Variants

Methods

fn check_profile

pub fn check_profile(points: &[DVec2]) -> Result<(), ProfileProblem>

Check a profile: a simple closed outline of a sensible size.

fn baseboard

pub fn baseboard() -> Vec<DVec2>

The profile of a new project’s sweep type: a baseboard 1.5 cm thick and 10 cm tall, on the left of the path.

cc_core::profiles_project

crates/cc_core/src/profiles_project.rs

Structural profiles in the project: lookups and repair of loaded files.

Items: TypeSection · section_name · section_name_in · SectorPlacement · type_profile · same_legacy · legacy_size

struct TypeSection

pub struct TypeSection

The section a column or beam type draws: its profile’s outline turned and mirrored, or the legacy section’s.

Traits: Debug, Clone, PartialEq

Fields

fn section_name

pub fn section_name(shape: &ProfileShape, material: ProfileMaterial) -> String

The name a converted section’s profile gets: I 200x200x9x15, Rect 20x40 (centimeters for concrete and timber rectangles and rounds, as section tags show them), Ø30, Tube 150x150x6.

fn section_name_in

pub fn section_name_in(shape: &ProfileShape, material: ProfileMaterial, system: crate::MeasurementSystem) -> String

section_name, or in an imperial project the same name with every size in inches (I 8"x8"x5/16"x7/16", Rect 8"x8", Ø12").

struct SectorPlacement

pub struct SectorPlacement

An annular sector section in its type’s frame: the ring’s center, the unit axis from it through the middle of the sector, the radii and the angle it turns (radians).

Traits: Debug, Clone, Copy, PartialEq

Fields

fn type_profile

pub(crate) fn type_profile(data: &TypeData) -> Option<ProfileId>

The profile a column or beam type points to.

fn same_legacy

pub(crate) fn same_legacy(a: &TypeData, b: &TypeData) -> bool

Whether two column or beam types have the same legacy section fields (section, or width, height and shape).

fn legacy_size

pub(crate) fn legacy_size(data: &TypeData) -> Option<(f64, f64)>

The legacy box of a column or beam type, (width, depth or height).

cc_core::project

crates/cc_core/src/project.rs

Items: ProjectField · ProjectInfo · Level · Project · Group · template_default · can_join_geometry · join_priority · natural_cmp

struct ProjectField

pub struct ProjectField

A project value named by the user (shown by title blocks as {project:Name}).

Traits: Debug, Clone, PartialEq, Default, Serialize, Deserialize

Fields

struct ProjectInfo

pub struct ProjectInfo

Traits: Debug, Clone, PartialEq, Default, Serialize, Deserialize

Fields

Methods

struct Level

pub struct Level

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

struct Project

pub struct Project

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Some fields are private.

Methods

struct Group

pub struct Group

Elements kept together: selecting one selects them all. An element belongs to one group at most.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

fn template_default

pub fn template_default(key: &str) -> &'static str

Portuguese names of the default template, keyed like the translation files.

fn can_join_geometry

pub fn can_join_geometry(category: crate::Category) -> bool

Whether elements of category have a body whose geometry can be joined.

fn join_priority

pub fn join_priority(element: &crate::Element) -> u8

How strongly an element cuts the elements it is joined with: of two joined elements, the higher cuts the lower. Structural columns and beams cut hosts (walls, roofs, ceilings, floors); floors, ceilings and roofs cut walls; walls cut architectural columns.

fn natural_cmp

pub fn natural_cmp(a: &str, b: &str) -> std::cmp::Ordering

Compare texts with their digit runs as numbers (A2 before A10).

cc_core::properties

crates/cc_core/src/properties.rs

Property and quantity sets carried over from IFC files: named sets of named values, each value keeping its IFC measure type. Lengths, areas, volumes and angles are stored in meters, square and cubic meters and radians, whatever the units of the file they came from.

Items: PropertySet · Property · PropertyValue · IfcValue · Atom · repair_sets

struct PropertySet

pub struct PropertySet

A property set (IfcPropertySet) or quantity set (IfcElementQuantity).

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

struct Property

pub struct Property

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

enum PropertyValue

pub enum PropertyValue

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Variants

Methods

struct IfcValue

pub struct IfcValue

A value with its IFC defined type (IFCLABEL, IFCLENGTHMEASURE…).

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

enum Atom

pub enum Atom

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Variants

Methods

fn repair_sets

pub fn repair_sets(sets: &mut [PropertySet]) -> usize

Drop properties with non-finite numbers; returns how many went.

cc_core::ramp

crates/cc_core/src/ramp.rs

Ramps: the plan shapes of a ramp element and the accessibility rules of its type (steepest slope, highest rise of one flight, shortest landing).

Items: RampShape · RampLayout · RampRules · RampIssue · RampCheck · MAX_FLIGHTS · ramp_flights

enum RampShape

pub enum RampShape

Plan shape of a ramp.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct RampLayout

pub struct RampLayout

Plan layout of a ramp element.

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Default

Fields

Methods

struct RampRules

pub struct RampRules

Accessibility rules of a ramp type (defaults after common accessibility codes: 8.33 % slope, 0.80 m rise per flight, 1.20 m landings).

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Default

Fields

Methods

enum RampIssue

pub enum RampIssue

A broken rule of a ramp.

Traits: Debug, Clone, Copy, PartialEq, Serialize

Variants

Methods

struct RampCheck

pub struct RampCheck

Slope, flights and the rules a ramp breaks.

Traits: Debug, Clone, PartialEq, Serialize

Fields

Methods

const MAX_FLIGHTS

pub const MAX_FLIGHTS: usize

Most flights of one ramp.

fn ramp_flights

pub fn ramp_flights(height: f64, rules: &RampRules, layout: &RampLayout) -> RampCheck

Slope, flight count, rise and run of each flight of a ramp rising height laid out as layout, and what it breaks of rules. Straight and U-shaped ramps get as many flights as the highest flight rise needs; L-shaped ones two; spiral ones one.

cc_core::raster

crates/cc_core/src/raster.rs

Raster images kept in a project (imported pictures, scanned drawings): the file’s own bytes, unchanged, with the format and pixel size. Project files hold the bytes as base64 text.

Items: MAX_IMAGE_BYTES · MAX_IMAGE_PIXELS · RasterFormat · RasterImage · base64_encode · base64_decode

const MAX_IMAGE_BYTES

pub const MAX_IMAGE_BYTES: usize

Largest image file kept, bytes.

const MAX_IMAGE_PIXELS

pub const MAX_IMAGE_PIXELS: u64

Most pixels an image may have (width × height): decoding one takes up to 8 bytes per pixel, plus 4 for its RGBA copy.

enum RasterFormat

pub enum RasterFormat

Encoding of an image’s bytes.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize

Variants

Methods

struct RasterImage

pub struct RasterImage

An image file’s bytes with its format and size in pixels.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

fn base64_encode

pub fn base64_encode(bytes: &[u8]) -> String

Standard base64 with padding.

fn base64_decode

pub fn base64_decode(text: &str) -> Option<Vec<u8>>

Decode standard base64 (whitespace ignored); None on any other character.

cc_core::recovery

crates/cc_core/src/recovery.rs

Crash recovery: while a project has unsaved changes, a copy of it is written now and then to a recovery folder, so a crash (or a power cut) loses at most the last few minutes of work. Each running session writes its own entry: a plain .ccad file (it opens like any project) and a small .meta file naming the project and where it was saved. Both are written to a temporary file first and renamed, so an entry is never half written. A clean save or close removes the entry; at start-up, the entries left by earlier sessions are offered for restoring.

Items: RecoveryMeta · RecoveryEntry · now_seconds · write · remove · list · load · AutosaveAction · Autosave

struct RecoveryMeta

pub struct RecoveryMeta

What a recovery entry says about the project it holds.

Traits: Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default

Fields

struct RecoveryEntry

pub struct RecoveryEntry

A recovery entry found on disk.

Traits: Debug, Clone, PartialEq, Eq

Fields

fn now_seconds

pub fn now_seconds() -> u64

Seconds since the Unix epoch (0 if the clock is before it).

fn write

pub fn write(dir: &Path, id: &str, project: &Project, meta: &RecoveryMeta) -> Result<PathBuf, PersistError>

Write the recovery entry id in dir (created if needed): the project first, then its meta file, each atomically. Returns the project’s path.

fn remove

pub fn remove(dir: &Path, id: &str)

Remove the recovery entry id from dir (nothing if there is none).

fn list

pub fn list(dir: &Path) -> Vec<RecoveryEntry>

The recovery entries in dir, the newest first: those whose project file exists (a meta file that cannot be read still offers its project).

fn load

pub fn load(entry: &RecoveryEntry) -> Result<(Project, usize), PersistError>

Load the project of a recovery entry (repaired like any opened file).

enum AutosaveAction

pub enum AutosaveAction

What Autosave::poll asks the caller to do.

Traits: Debug, Clone, Copy, PartialEq, Eq

Variants

struct Autosave

pub struct Autosave

When to write a recovery copy: once the document has had unsaved changes for interval, and only if its revision changed since the last copy.

Traits: Debug, Clone

Fields

Some fields are private.

Methods

cc_core::region

crates/cc_core/src/region.rs

Regions: 2D areas drawn in one view, owned by it like detail lines and text notes (Element::owner_view), in the view’s drawing coordinates (meters). An outline with openings, usually drawn as a sketch (crate::sketch::Sketch::profile), and an optional boundary line style (none: no boundary is drawn).

Items: MAX_POINTS · MAX_OPENINGS · Region

const MAX_POINTS

pub const MAX_POINTS: usize

Most points of an outline or an opening, and most openings (a crafted file).

const MAX_OPENINGS

pub const MAX_OPENINGS: usize

struct Region

pub struct Region

A filled or masking region of one view.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

cc_core::render_settings

crates/cc_core/src/render_settings.rs

Per-view settings of photorealistic rendering (path tracing). A view that takes them (crate::ViewKind::takes_render: 3D views) keeps a RenderSettings in crate::View::render: the samples per pixel, the light bounces, the output size, the field of view, the exposure and tone mapping, the firefly clamp, the clay mode and the environment (sky, sun and ground). Every field has a serde default, so settings written by older or newer builds load; values out of range are brought back by RenderSettings::repair.

Items: MIN_SAMPLES · MAX_SAMPLES · DEFAULT_SAMPLES · MIN_DEPTH · MAX_DEPTH · DEFAULT_DEPTH · MIN_SIZE · MAX_SIZE · MAX_PIXELS · DEFAULT_WIDTH · DEFAULT_HEIGHT · MIN_FOV_DEG · MAX_FOV_DEG · DEFAULT_FOV_DEG · MIN_EXPOSURE · MAX_EXPOSURE · DEFAULT_EXPOSURE · MIN_CLAMP · MAX_CLAMP · DEFAULT_CLAMP · MIN_STRENGTH · MAX_STRENGTH · DEFAULT_SKY_STRENGTH · DEFAULT_SUN_STRENGTH · DEFAULT_GROUND_COLOR · ToneMap · RenderEnvironment · RenderSettings

const MIN_SAMPLES

pub const MIN_SAMPLES: u32

Fewest samples per pixel.

const MAX_SAMPLES

pub const MAX_SAMPLES: u32

Most samples per pixel.

const DEFAULT_SAMPLES

pub const DEFAULT_SAMPLES: u32

Samples per pixel of new settings.

const MIN_DEPTH

pub const MIN_DEPTH: u32

Fewest light bounces.

const MAX_DEPTH

pub const MAX_DEPTH: u32

Most light bounces.

const DEFAULT_DEPTH

pub const DEFAULT_DEPTH: u32

Light bounces of new settings.

const MIN_SIZE

pub const MIN_SIZE: u32

Smallest output width or height, pixels.

const MAX_SIZE

pub const MAX_SIZE: u32

Largest output width or height, pixels.

const MAX_PIXELS

pub const MAX_PIXELS: u64

Most output pixels (7680 x 4320).

const DEFAULT_WIDTH

pub const DEFAULT_WIDTH: u32

Output width of new settings, pixels.

const DEFAULT_HEIGHT

pub const DEFAULT_HEIGHT: u32

Output height of new settings, pixels.

const MIN_FOV_DEG

pub const MIN_FOV_DEG: f64

Narrowest vertical field of view, degrees.

const MAX_FOV_DEG

pub const MAX_FOV_DEG: f64

Widest vertical field of view, degrees.

const DEFAULT_FOV_DEG

pub const DEFAULT_FOV_DEG: f64

Vertical field of view of new settings, degrees (the 3D viewport’s).

const MIN_EXPOSURE

pub const MIN_EXPOSURE: f64

Lowest exposure, stops.

const MAX_EXPOSURE

pub const MAX_EXPOSURE: f64

Highest exposure, stops.

const DEFAULT_EXPOSURE

pub const DEFAULT_EXPOSURE: f64

Exposure of new settings, stops.

const MIN_CLAMP

pub const MIN_CLAMP: f64

Lowest sample clamp (0 turns it off).

const MAX_CLAMP

pub const MAX_CLAMP: f64

Highest sample clamp.

const DEFAULT_CLAMP

pub const DEFAULT_CLAMP: f64

Sample clamp of new settings.

const MIN_STRENGTH

pub const MIN_STRENGTH: f64

Lowest sky or sun strength.

const MAX_STRENGTH

pub const MAX_STRENGTH: f64

Highest sky or sun strength.

const DEFAULT_SKY_STRENGTH

pub const DEFAULT_SKY_STRENGTH: f64

Sky strength of new settings.

const DEFAULT_SUN_STRENGTH

pub const DEFAULT_SUN_STRENGTH: f64

Sun strength of new settings.

const DEFAULT_GROUND_COLOR

pub const DEFAULT_GROUND_COLOR: [u8; 3]

Ground color of new settings: a neutral warm gray.

enum ToneMap

pub enum ToneMap

How the rendered radiance is mapped to display colors.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct RenderEnvironment

pub struct RenderEnvironment

The light around the model: sky, sun and ground.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize, Default

Fields

Methods

struct RenderSettings

pub struct RenderSettings

How a view is rendered photorealistically.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize, Default

Fields

Methods

cc_core::repair

crates/cc_core/src/repair.rs

Repair of projects read from files, which may be damaged or crafted: invalid numbers and dangling references are removed or reset so the rest of the program can rely on a consistent model.

cc_core::roofing

crates/cc_core/src/roofing.rs

Roof coverings and framing. A roof type may name its tiles (a kind from a built-in catalog, with reference values: the least slope they take, their weight, how many make a square meter, the batten gauge and the widest span between purlins) and its framing: purlins with rafters and battens (timber), or purlins only (steel, for sheets). The framing is derived from the roof’s sloped faces (see cc_geom::roof_framing). The catalog’s values are typical figures from public product data, for early design; manufacturers’ figures prevail.

Items: TileKind · TileSpec · FramingSystem · MemberSize · RoofFraming

enum TileKind

pub enum TileKind

Kinds of roof covering.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize

Variants

Methods

struct TileSpec

pub struct TileSpec

What a kind of covering takes and weighs.

Traits: Debug, Clone, Copy, PartialEq

Fields

Methods

enum FramingSystem

pub enum FramingSystem

How a roof is framed.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct MemberSize

pub struct MemberSize

A member’s section: width and height, meters.

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize

Fields

Methods

struct RoofFraming

pub struct RoofFraming

The framing of a roof type: members under its sloped faces.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize, Default

Fields

Methods

cc_core::scale

crates/cc_core/src/scale.rs

Drawing scales as people read them: 1:50 in metric projects, the customary 1/4" = 1'-0" in imperial ones. A view keeps its scale as the ratio N of 1:N (View::scale); this only names and reads it.

Items: IMPERIAL · label · choices · parse

const IMPERIAL

pub const IMPERIAL: [(u32, &str); 19]

The customary imperial scales: ratio and label (architectural, then engineering).

fn label

pub fn label(system: MeasurementSystem, n: u32) -> String

The scale 1:n as a project of system writes it: the customary label of an imperial scale in the table, else 1:n.

fn choices

pub fn choices(system: MeasurementSystem) -> &'static [u32]

The scales a scale picker offers in a project of system, ascending.

fn parse

pub fn parse(text: &str) -> Option<u32>

Reads a scale typed as 1:48, 48 or a label of the imperial table (1/4" = 1'-0", spaces optional, 1' for 1'-0"). Zero is refused.

cc_core::schedule

crates/cc_core/src/schedule.rs

Schedule definitions: which fields a schedule shows, how rows are filtered, sorted and grouped, how each column is formatted and how the table looks on paper. The values are computed by cc_views::schedule.

Items: ScheduleField · ScheduleDef · MAX_BENDING_PARTITIONS · MAX_WASTE_PERCENT · BendingOptions · MAX_FILTERS · MAX_SORT_LEVELS · MAX_SCHEDULE_TEXT · MIN_SCHEDULE_TEXT_SIZE · MAX_SCHEDULE_TEXT_SIZE · ScheduleFilter · SortLevel · ColumnAlign · ColumnFormat · ScheduleAppearance

enum ScheduleField

pub enum ScheduleField

A column a schedule can show.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize

Variants

Methods

struct ScheduleDef

pub struct ScheduleDef

What a schedule shows. Empty fields means the category defaults (files written before schedules were configurable).

Traits: Debug, Clone, PartialEq, Default, Serialize, Deserialize

Fields

Methods

const MAX_BENDING_PARTITIONS

pub const MAX_BENDING_PARTITIONS: usize

Most partitions a bending schedule is limited to.

const MAX_WASTE_PERCENT

pub const MAX_WASTE_PERCENT: f64

Largest waste a bending schedule adds, percent.

struct BendingOptions

pub struct BendingOptions

What a bending schedule shows: one row per bar mark (mark, diameter, grade, shape sketch with its dimensions, length of one bar, count, total length, weight; rows of bars longer than the stock length noted), then a summary per diameter and grade (total length and weight, with the waste added when given).

Traits: Debug, Clone, PartialEq, Default, Serialize, Deserialize

Fields

Methods

const MAX_FILTERS

pub const MAX_FILTERS: usize

Most filters of one schedule.

const MAX_SORT_LEVELS

pub const MAX_SORT_LEVELS: usize

Most levels of sorting of one schedule.

const MAX_SCHEDULE_TEXT

pub const MAX_SCHEDULE_TEXT: usize

Longest filter value or column heading, in characters.

const MIN_SCHEDULE_TEXT_SIZE

pub const MIN_SCHEDULE_TEXT_SIZE: f64

Smallest and largest text of a schedule on paper, millimeters.

const MAX_SCHEDULE_TEXT_SIZE

pub const MAX_SCHEDULE_TEXT_SIZE: f64

struct ScheduleFilter

pub struct ScheduleFilter

One filter: rows whose field compares as op says with value stay. A number is compared as a number when the row’s value is one (lengths in meters, areas in square meters, and so on), else as text without case.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

struct SortLevel

pub struct SortLevel

One level of sorting: rows in the order of field; a level may write a heading before each group of rows alike in it, a footer after it (the group’s count and totals) and leave a blank line between groups.

Traits: Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize

Fields

Methods

enum ColumnAlign

pub enum ColumnAlign

Where a column’s texts stand in their cells.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct ColumnFormat

pub struct ColumnFormat

How the column of field is written: its own heading, its alignment, whether it is left out of the table (a hidden field still sorts and filters) and whether it is totaled (None: as the field usually is).

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

struct ScheduleAppearance

pub struct ScheduleAppearance

How a schedule looks on paper (sheets and exports): its rules, its title and headers, and the sizes of its texts in millimeters.

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Default

Fields

Methods

cc_core::section_props

crates/cc_core/src/section_props.rs

Geometric properties of a section outline (area, centroid, second moments, moduli, radii of gyration, torsion constant, mass per length), computed exactly for the polygon with Green’s theorem. SI units.

Items: SectionProperties

struct SectionProperties

pub struct SectionProperties

Properties of a section. Units: m, m², m⁴, m³ and kg/m.

Traits: Debug, Clone, Copy, PartialEq, Default, Serialize

Fields

cc_core::shaft

crates/cc_core/src/shaft.rs

Shaft openings: a vertical opening with an outline in plan, from its level (plus base_offset) up to a level or a height, that cuts every floor, ceiling and roof it passes through. The cuts are written into those elements (cuts) by every edit (see crate::EditCtx), so plans, schedules, 3D views and IFC export see the holes like any opening. A shaft cuts an element only where its outline lies inside the element’s outline, clear of its own openings.

Items: MAX_OUTLINE · Shaft · fits

const MAX_OUTLINE

pub const MAX_OUTLINE: usize

Most points of a shaft’s outline.

struct Shaft

pub struct Shaft

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

fn fits

pub fn fits(outline: &[DVec2], boundary: &[DVec2], holes: &[Vec<DVec2>]) -> bool

Whether outline lies inside boundary and clear of each of holes (no shared edges or points either): a hole it can cut.

cc_core::site

crates/cc_core/src/site.rs

Where the project stands on Earth: the geographic position of the project origin, its height above sea level, the direction of true north and the parts of its postal address, plus the conversion between latitude/longitude and the project’s own coordinates (meters) used to bring map data in.

Items: ELEVATION_RANGE · MAX_TEXT · SiteLocation · SiteAddress · normalize_angle · to_dms · from_dms

const ELEVATION_RANGE

pub const ELEVATION_RANGE: std::ops::RangeInclusive<f64>

Lowest and highest site elevation accepted, meters (the Dead Sea shore to above Everest).

const MAX_TEXT

pub const MAX_TEXT: usize

Longest text kept in one address part, bytes.

struct SiteLocation

pub struct SiteLocation

The geographic location of the project origin ([0, 0] at level elevation 0) with its postal address.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

struct SiteAddress

pub struct SiteAddress

Parts of a postal address (any may be empty).

Traits: Debug, Clone, PartialEq, Default, Serialize, Deserialize

Fields

Methods

fn normalize_angle

pub fn normalize_angle(a: f64) -> f64

a degrees in (-180, 180].

fn to_dms

pub fn to_dms(deg: f64) -> [i64; 4]

Degrees as IFC’s compound plane angle: degrees, minutes, seconds and millionths of a second, all with the sign of the angle.

fn from_dms

pub fn from_dms(parts: &[i64]) -> Option<f64>

Degrees from IFC’s compound plane angle (three or four parts; the sign of any part makes it negative).

cc_core::sketch

crates/cc_core/src/sketch.rs

Sketches: the curves an outline is drawn with (lines, arcs, circles and ellipses; rectangles and polygons are drawn as lines). A floor, ceiling, roof, foundation slab or mass keeps the sketch it was drawn from, so its boundary can be edited again curve by curve; its outline (the polygon the geometry is built from) is the sketch’s loops, arcs and ellipses split into short chords. Sketch::profile chains the curves into closed loops: the one around all the others is the outline, the others are openings in it. Ends meet within JOIN_TOL; open ends, curves branching at a point, loops that cross themselves or each other, and loops apart from or nested in each other are errors, with the point where they happen.

Items: JOIN_TOL · MAX_CURVES · MAX_POINTS · SketchCurve · SketchError · Profile · Sketch

const JOIN_TOL

pub const JOIN_TOL: f64

Ends closer than this (meters) join.

const MAX_CURVES

pub const MAX_CURVES: usize

Most curves a sketch holds (a guard against crafted files).

const MAX_POINTS

pub const MAX_POINTS: usize

Most points the loops of a sketch make.

enum SketchCurve

pub enum SketchCurve

A curve of a sketch, in plan coordinates (meters).

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Variants

Methods

enum SketchError

pub enum SketchError

Why a sketch makes no outline.

Traits: Debug, Clone, Copy, PartialEq, std::fmt::Display

Variants

Methods

struct Profile

pub struct Profile

An outline and the openings in it, from a sketch.

Traits: Debug, Clone, PartialEq, Default

Fields

struct Sketch

pub struct Sketch

The curves an outline is drawn with.

Traits: Debug, Clone, PartialEq, Default, Serialize, Deserialize

Fields

Methods

cc_core::sketch_edit

crates/cc_core/src/sketch_edit.rs

Editing the curves of a sketch: where two curves (or the lines, circles and ellipses they lie on) cross, a curve trimmed or extended to a point, split in two, and offset alone or along the chain of curves joined to it. The sketch tools of the app use these; None means the edit makes no valid curve (closed curves have no end to trim, ellipses no offset that is an ellipse, curves that never meet).

Items: crossings · nearest · param · span · between · trim_to · trim_corner · trim_extend · split · offset_left · offset · chain · offset_chain

fn crossings

pub fn crossings(a: &SketchCurve, b: &SketchCurve) -> Vec<DVec2>

Where the lines, circles and ellipses curves a and b lie on cross (lines run on past their ends, arcs round their circle, partial ellipses round the whole ellipse). Tangent contacts may be missed.

fn nearest

pub fn nearest(points: &[DVec2], to: DVec2) -> Option<DVec2>

The point of points nearest to.

fn param

pub fn param(c: &SketchCurve, p: DVec2) -> Option<f64>

Where p lies along an open curve from its start: meters along lines and arcs, radians of the parameter along ellipses; before the start it is negative and past the end greater than span, where the curve runs on. None for closed curves.

fn span

pub fn span(c: &SketchCurve) -> Option<f64>

The parameter of an open curve’s end (see param).

fn between

pub fn between(c: &SketchCurve, u0: f64, u1: f64) -> Option<SketchCurve>

The part of an open curve between the parameters u0 < u1 (see param); beyond its ends the curve runs on, so this also extends it.

fn trim_to

pub fn trim_to(c: &SketchCurve, keep: DVec2, at: DVec2) -> Option<SketchCurve>

The open curve c ending at at (a point on it or where it runs on), keeping the side of at where keep is: trimmed or extended.

fn trim_corner

pub fn trim_corner(c1: &SketchCurve, k1: DVec2, c2: &SketchCurve, k2: DVec2) -> Option<(SketchCurve, SketchCurve)>

Two curves trimmed or extended to meet where they cross, each keeping the side clicked (k1, k2); the crossing nearest the clicks.

fn trim_extend

pub fn trim_extend(c: &SketchCurve, keep: DVec2, boundary: &SketchCurve) -> Option<SketchCurve>

Curve c trimmed or extended to the curve boundary, keeping the side clicked (keep); the crossing nearest the click.

fn split

pub fn split(c: &SketchCurve, p: DVec2) -> Option<(SketchCurve, SketchCurve)>

Curve c split in two at the point of it nearest p. A circle or a whole ellipse splits into halves, from p and from the point opposite.

fn offset_left

pub fn offset_left(c: &SketchCurve, v: f64) -> Option<SketchCurve>

Curve c moved v to its left (to its right when negative); None for ellipses and when an arc’s or a circle’s radius would vanish.

fn offset

pub fn offset(c: &SketchCurve, distance: f64, toward: DVec2) -> Option<SketchCurve>

A copy of curve c distance away from it, on the side of toward.

fn chain

pub fn chain(curves: &[SketchCurve], i: usize) -> (Vec<(usize, bool)>, bool)

The curves joined end to end with curve i, in order along the chain, each with whether it runs backwards in it, and whether the chain closes. The chain stops where more than two curves meet.

fn offset_chain

pub fn offset_chain(curves: &[SketchCurve], i: usize, distance: f64, toward: DVec2) -> Option<Vec<SketchCurve>>

Copies of the chain of curve i (see chain) distance away on the side of toward, neighbors meeting where their copies cross (or joined by a line where they do not); None when a curve has no offset.

cc_core::spline

crates/cc_core/src/spline.rs

Splines of sketches: a chain of cubic Bézier segments, kept as their control points p0 c1 c2 p1 c1 c2 p2 … (3n + 1 points for n segments). The drawing tool passes through the points clicked (interpolate); splitting (split_at), reversing, moving and the enclosed area (swept_area) stay exact on that form.

Items: MAX_SEGMENTS · STEPS · segment_count · segment · segments · is_valid · is_closed · point · derivative · point_at · direction_at · flatten · length · swept_area · split · split_at · between · nearest · reversed · interpolate · offset

const MAX_SEGMENTS

pub const MAX_SEGMENTS: usize

Most segments a spline holds (a guard against crafted files).

const STEPS

pub const STEPS: usize

Points each segment is split into to draw it.

fn segment_count

pub fn segment_count(points: &[DVec2]) -> Option<usize>

The number of segments of points, when they are a spline’s control points.

fn segment

pub fn segment(points: &[DVec2], i: usize) -> Option<[DVec2; 4]>

The control points of segment i.

fn segments

pub fn segments(points: &[DVec2]) -> impl Iterator<Item = [DVec2; 4]> + '_

The segments of points.

fn is_valid

pub fn is_valid(points: &[DVec2]) -> bool

A whole number of segments, not too many, finite, and not all in one point.

fn is_closed

pub fn is_closed(points: &[DVec2]) -> bool

Whether the spline ends where it starts (with more than one segment).

fn point

pub fn point([p0, p1, p2, p3]: [DVec2; 4], t: f64) -> DVec2

The point of a segment at t in 0..=1.

fn derivative

pub fn derivative([p0, p1, p2, p3]: [DVec2; 4], t: f64) -> DVec2

The derivative of a segment at t.

fn point_at

pub fn point_at(points: &[DVec2], s: f64) -> Option<DVec2>

The point at the spline’s parameter s in 0..=n (segment floor(s)).

fn direction_at

pub fn direction_at(points: &[DVec2], s: f64) -> Option<DVec2>

The unit direction of travel at the parameter s.

fn flatten

pub fn flatten(points: &[DVec2]) -> Vec<DVec2>

The spline as points from its start to its end, each segment split in STEPS; the ends are exact.

fn length

pub fn length(points: &[DVec2]) -> f64

The length of the drawn spline.

fn swept_area

pub fn swept_area(points: &[DVec2]) -> f64

The signed area the spline sweeps around the origin, the integral of (x dy - y dx) / 2 along it, exact: the integrand is a polynomial of degree 5, which 3-point Gauss-Legendre integrates exactly.

fn split

pub fn split([p0, p1, p2, p3]: [DVec2; 4], t: f64) -> ([DVec2; 4], [DVec2; 4])

A segment split at t: the part before and the part after.

fn split_at

pub fn split_at(points: &[DVec2], s: f64) -> Option<(Vec<DVec2>, Vec<DVec2>)>

The spline split at its parameter s: the part before and the part after (either may be empty at an end).

fn between

pub fn between(points: &[DVec2], s0: f64, s1: f64) -> Option<Vec<DVec2>>

The part of the spline between the parameters s0 and s1 (s0 < s1).

fn nearest

pub fn nearest(points: &[DVec2], q: DVec2) -> Option<(f64, DVec2, f64)>

The nearest point of the spline to q: its parameter, the point and the distance.

fn reversed

pub fn reversed(points: &[DVec2]) -> Vec<DVec2>

The same spline run the other way.

fn interpolate

pub fn interpolate(fit: &[DVec2], closed: bool) -> Vec<DVec2>

A spline through the fit points (closed back to the first when closed): tangents from the neighbors, spaced by the distances between the points, so it neither overshoots short spans nor flattens long ones. Points repeated in a row count once; fewer than two distinct points make no spline.

fn offset

pub fn offset(points: &[DVec2], d: f64) -> Vec<DVec2>

A spline d to the left of this one (to the right when negative), as near as offsetting each segment’s control points along its end normals allows (exact for straight segments, close for gentle curves).

cc_core::stair

crates/cc_core/src/stair.rs

Stairs: the plan shapes of a stair element, how its type is built (solid, cast in place, assembled) and the rules that size its steps (riser limits and Blondel’s formula 2 × riser + tread).

Items: StairShape · Turn · StairLayout · MAX_STEP_NUMBER · MAX_WINDERS · MAX_RISERS · StairConstruction · Stringers · LandingBeams · PostAt · LandingPosts · StairBuild · TreadRule · StairRules · stair_steps · StairIssue · StairCheck · StairSide · StairRailing

enum StairShape

pub enum StairShape

Plan shape of a stair.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

enum Turn

pub enum Turn

Side a stair turns to, walking up.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct StairLayout

pub struct StairLayout

Plan layout of a stair element (all fields have defaults, so files from before shaped stairs read as straight ones).

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Default

Fields

Methods

const MAX_STEP_NUMBER

pub const MAX_STEP_NUMBER: i32

Largest step number, either way from zero.

const MAX_WINDERS

pub const MAX_WINDERS: u32

Most winder treads in one corner.

const MAX_RISERS

pub const MAX_RISERS: u32

Most risers in one stair.

enum StairConstruction

pub enum StairConstruction

How a stair is built.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

enum Stringers

pub enum Stringers

Where the stringers of an assembled stair go.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

enum LandingBeams

pub enum LandingBeams

How the beams under a landing of an assembled stair with a central stringer run (with side stringers they frame the landing’s edge).

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

enum PostAt

pub enum PostAt

A place round the edge of a landing where a post can stand: a corner or the middle of an edge, named walking onto the landing (front: the edge the stair arrives at; inner: the side the stair turns to).

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize

Variants

Methods

struct LandingPosts

pub struct LandingPosts

Where posts stand under one landing (only places where the landing’s beams reach its edge take one, see cc_geom::StairLanding::post_spots).

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Fields

Methods

struct StairBuild

pub struct StairBuild

Construction of a stair type.

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Default

Fields

Methods

enum TreadRule

pub enum TreadRule

How the tread depth of a stair type is set.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct StairRules

pub struct StairRules

Comfort and safety limits of a stair type (defaults after common building codes: risers 16-18 cm, treads at least 28 cm and 2 × riser + tread between 63 and 65 cm).

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Default

Fields

Methods

fn stair_steps

pub fn stair_steps(height: f64, max_riser: f64, tread: f64, rules: &StairRules) -> (usize, f64, f64)

Riser count, riser height and tread depth of a stair of height: the fewest risers at most max_riser high; the tread from the rules.

enum StairIssue

pub enum StairIssue

A broken rule of a stair.

Traits: Debug, Clone, Copy, PartialEq, Serialize

Variants

Methods

struct StairCheck

pub struct StairCheck

Riser, tread (on the walking line), Blondel’s step and the rules they break.

Traits: Debug, Clone, PartialEq, Serialize

Fields

Methods

enum StairSide

pub enum StairSide

Side of a stair, walking up.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct StairRailing

pub struct StairRailing

A railing that follows a side of a stair (host), inset in from its edge.

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize

Fields

cc_core::steel_building

crates/cc_core/src/steel_building.rs

Parametric steel buildings: a host element that holds the parameters of a steel shed (span, eave height, roof slope and shape, bays, the types of its members, purlins and girts) and owns ordinary columns and beams made from them. Every edit keeps the members in step (see crate::EditCtx): a changed building rewrites its members in place, keeping their ids while their roles exist; a member the user edited or deleted is detached, and the building leaves its role alone from then on. Local coordinates: x across the span (from the first column line), y along the building (frame k at k * bay_spacing), mapped to plan through origin and rotation_deg.

Items: MAX_MEMBERS · MISSING_SECTION · SPAN · EAVE_HEIGHT · SLOPE · BAYS · BAY_SPACING · SPACING · DEFAULT_SPAN · DEFAULT_EAVE_HEIGHT · DEFAULT_SLOPE · DEFAULT_BAYS · DEFAULT_BAY_SPACING · DEFAULT_SECONDARY_SPACING · FrameRoof · RoleKind · MemberRole · Secondary · FrameMember · SteelBuilding · section_box · host_type

const MAX_MEMBERS

pub const MAX_MEMBERS: usize

Most members one building makes; the layout stops there.

const MISSING_SECTION

pub const MISSING_SECTION: f64

The width and depth of a type whose section cannot be read, meters.

const SPAN

pub const SPAN: RangeInclusive<f64>

const EAVE_HEIGHT

pub const EAVE_HEIGHT: RangeInclusive<f64>

const SLOPE

pub const SLOPE: RangeInclusive<f64>

const BAYS

pub const BAYS: RangeInclusive<u32>

const BAY_SPACING

pub const BAY_SPACING: RangeInclusive<f64>

const SPACING

pub const SPACING: RangeInclusive<f64>

Purlin and girt spacing.

const DEFAULT_SPAN

pub const DEFAULT_SPAN: f64

const DEFAULT_EAVE_HEIGHT

pub const DEFAULT_EAVE_HEIGHT: f64

const DEFAULT_SLOPE

pub const DEFAULT_SLOPE: f64

const DEFAULT_BAYS

pub const DEFAULT_BAYS: u32

const DEFAULT_BAY_SPACING

pub const DEFAULT_BAY_SPACING: f64

const DEFAULT_SECONDARY_SPACING

pub const DEFAULT_SECONDARY_SPACING: f64

enum FrameRoof

pub enum FrameRoof

The roof of the frames: two rafters meeting at mid-span, or one rising toward x = span.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

enum RoleKind

pub enum RoleKind

What a member is in its building.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize

Variants

Methods

struct MemberRole

pub struct MemberRole

A member’s place: its kind, its frame (columns, rafters) or bay (purlins, girts), and its index there (girts: side * 1000 + row).

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize

Fields

Methods

struct Secondary

pub struct Secondary

Purlins or girts: their beam type and the distance between lines (purlins: along the rafter’s plan run; girts: up the wall).

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize

Fields

struct FrameMember

pub struct FrameMember

A member the building manages.

Traits: Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize

Fields

struct SteelBuilding

pub struct SteelBuilding

Traits: Debug, Clone, PartialEq, Serialize, Deserialize, MemberHost

Fields

Methods

fn section_box

pub fn section_box(project: &Project, type_id: ElementTypeId) -> (f64, f64)

The width (across) and depth (up) of a column or beam type’s section box, MISSING_SECTION each when it cannot be read.

fn host_type

pub fn host_type(id: ElementTypeId, name: String) -> ElementType

The type a project gets with its first steel building.

cc_core::structural_material

crates/cc_core/src/structural_material.rs

The structural material of a column or beam type: concrete, steel (rolled or cold-formed) or timber. It comes from the type’s profile, else from the type’s own material (a legacy section that makes no outline).

Items: StructuralMaterial

enum StructuralMaterial

pub enum StructuralMaterial

What a column or beam is made of, as the Structure tab groups its tools.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Default

Variants

Methods

cc_core::structural_profile

crates/cc_core/src/structural_profile.rs

Structural profiles: the cross-sections of columns, beams and framing members as named project objects (Project::profiles). A profile is a standard parametric shape (rolled, welded, cold-formed, timber or concrete) or a parametric sketch (ParamSketch). Lengths are meters. Outlines are laid out as in steel tables: the depth along +y, the web of an I or channel vertical, the flanges of a channel and the legs of an angle pointing to +x; centered on the bounding box.

Items: ARC_SEGMENTS · MAX_POINTS · MAX_OPENINGS · MIN_THICKNESS · MAX_SIZE · MAX_NAME · MAX_DESCRIPTION · MAX_PROFILES · ProfileMaterial · ProfileShape · MAX_SKETCH_PARAMS · ParamSketch · SectionOutline · ProfileError · CatalogRef · ProfileDef

const ARC_SEGMENTS

pub const ARC_SEGMENTS: usize

Segments of an arc that turns a quarter circle (fillets use this many).

const MAX_POINTS

pub const MAX_POINTS: usize

Most points in an outline, holes included.

const MAX_OPENINGS

pub const MAX_OPENINGS: usize

Most holes in an outline.

const MIN_THICKNESS

pub const MIN_THICKNESS: f64

Smallest dimension, meters.

const MAX_SIZE

pub const MAX_SIZE: f64

Largest dimension, meters.

const MAX_NAME

pub const MAX_NAME: usize

Longest profile name, characters.

const MAX_DESCRIPTION

pub const MAX_DESCRIPTION: usize

Longest description, characters.

const MAX_PROFILES

pub const MAX_PROFILES: usize

Most profiles in a project (a crafted file).

enum ProfileMaterial

pub enum ProfileMaterial

What a profile is made of; decides the material a type made for it gets.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

enum ProfileShape

pub enum ProfileShape

A standard parametric cross-section; every field is a length in meters except ColdZ::angle (degrees).

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Variants

Methods

const MAX_SKETCH_PARAMS

pub const MAX_SKETCH_PARAMS: usize

Most parameters of a sketch.

struct ParamSketch

pub struct ParamSketch

A parametric sketch: an outline and openings whose points are expressions over named numeric parameters (meters).

Traits: Debug, Clone, PartialEq, Default, Serialize, Deserialize

Fields

Methods

struct SectionOutline

pub struct SectionOutline

An outline: outer runs counter-clockwise, holes clockwise.

Traits: Debug, Clone, PartialEq, Default

Fields

Methods

enum ProfileError

pub enum ProfileError

Traits: Debug, Clone, PartialEq, Error

Variants

struct CatalogRef

pub struct CatalogRef

Where a profile comes from in a manufacturer’s or standard’s table.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

struct ProfileDef

pub struct ProfileDef

A named profile of the project.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

cc_core::sun

crates/cc_core/src/sun.rs

The sun of a view: where it stands in the sky for a date, a time and the project’s site, and the settings each view keeps to place it. A view that takes a sun (ViewKind::takes_sun: plans, ceiling plans, 3D views, elevations and sections) may keep SunSettings in View::sun: a SunMode that is either a still moment, a study over one day or several days (a list of SunFrames, the current one chosen by SunSettings::frame), or a lighting direction given by hand. SunSettings::state (or Project::sun_state for a view) resolves them into a SunState: the sun’s azimuth and altitude and the unit vector towards it in project coordinates, turned by the site’s true north (SunSite, from crate::site::SiteLocation). The solar position uses the usual public low-precision formulas: the sun’s mean longitude and anomaly in Julian centuries from J2000 give its apparent longitude, the declination and the equation of time (good to about a hundredth of a degree and a few seconds for centuries around 2000), the true solar time gives the hour angle, and spherical trigonometry the altitude and azimuth. No atmospheric refraction is applied to positions; sunrise and sunset are when the sun’s upper limb meets the horizon, its center at HORIZON_ALTITUDE (refraction and the sun’s radius together). Named SunPresets live in Project::sun_presets, tracked as project settings (EditCtx::sun_presets_mut). Dates and times are local to the site: a date is a SunDate and a time of day is minutes after local midnight (u16, 0..=MAX_MINUTE in settings; f64 in frames and results). Everything is deterministic: nothing reads the clock.

Items: MAX_MINUTE · MAX_FRAMES · MAX_DAYS · MAX_PRESETS · MAX_PRESET_NAME · MIN_YEAR · MAX_YEAR · UTC_OFFSET_RANGE · HORIZON_ALTITUDE · CONVENTIONAL_AZIMUTH · conventional_altitude · SunDate · is_leap_year · days_in_month · SunPosition · Daylight · solar_position · solar_noon · daylight · day_path · sun_direction · SunSite · SunInterval · SunMode · SunFrame · SunSettings · SunState · view_forward · camera_forward · SunPreset · clean_preset_name · repair_presets

const MAX_MINUTE

pub const MAX_MINUTE: u16

The last minute of a day (23:59).

const MAX_FRAMES

pub const MAX_FRAMES: usize

Most frames a study yields; longer ones are cut.

const MAX_DAYS

pub const MAX_DAYS: usize

Most days a study walks through (a bound for studies spanning polar nights).

const MAX_PRESETS

pub const MAX_PRESETS: usize

Most presets a project keeps.

const MAX_PRESET_NAME

pub const MAX_PRESET_NAME: usize

Longest preset name, characters.

const MIN_YEAR

pub const MIN_YEAR: i32

Earliest and latest year of a SunDate.

const MAX_YEAR

pub const MAX_YEAR: i32

const UTC_OFFSET_RANGE

pub const UTC_OFFSET_RANGE: std::ops::RangeInclusive<f64>

Accepted offsets from UTC, hours.

const HORIZON_ALTITUDE

pub const HORIZON_ALTITUDE: f64

Altitude of the sun’s center, degrees, when its upper limb touches the horizon (34’ of refraction plus 16’ of radius).

const CONVENTIONAL_AZIMUTH

pub const CONVENTIONAL_AZIMUTH: f64

The conventional sun’s azimuth relative to the view: behind the viewer, to the left (clockwise from the look direction).

fn conventional_altitude

pub fn conventional_altitude() -> f64

The conventional sun’s altitude, degrees: that of a cube’s diagonal, atan(1 / √2) (about 35.26°).

struct SunDate

pub struct SunDate

A calendar date (proleptic Gregorian), local to the site.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize, Default, std::fmt::Display

Fields

Methods

fn is_leap_year

pub fn is_leap_year(year: i32) -> bool

Whether year has a February 29.

fn days_in_month

pub fn days_in_month(year: i32, month: u8) -> u8

Days in month (1 to 12) of year; 0 for a month out of range.

struct SunPosition

pub struct SunPosition

Where the sun stands in the sky, degrees.

Traits: Debug, Clone, Copy, PartialEq, Default

Fields

enum Daylight

pub enum Daylight

When the sun rises and sets on a day.

Traits: Debug, Clone, Copy, PartialEq

Variants

fn solar_position

pub fn solar_position(latitude: f64, longitude: f64, utc_offset_hours: f64, date: SunDate, minutes: f64) -> SunPosition

The sun’s position seen from latitude, longitude (degrees, WGS 84, north and east positive) on date at minutes after local midnight, local time being utc_offset_hours east of UTC. Azimuth clockwise from true north, altitude without atmospheric refraction. Inputs that are not numbers or out of range are brought into range; nothing returns NaN.

fn solar_noon

pub fn solar_noon(longitude: f64, utc_offset_hours: f64, date: SunDate) -> f64

Local solar noon on date at longitude, minutes after local midnight.

fn daylight

pub fn daylight(latitude: f64, longitude: f64, utc_offset_hours: f64, date: SunDate) -> Daylight

Sunrise and sunset on date at the site (see Daylight).

fn day_path

pub fn day_path(site: &SunSite, date: SunDate, step_minutes: f64) -> Vec<(f64, SunPosition)>

The sun’s path over date at the site, every step_minutes (1 to 1440; 15 when not a number) from 00:00 to 24:00, both included, for sun path diagrams: callers keep the part above the horizon. At most 1441 points.

fn sun_direction

pub fn sun_direction(north: DVec2, azimuth: f64, altitude: f64) -> DVec3

The unit vector from the model towards the sun, in project coordinates, for a sun at azimuth (clockwise from true north) and altitude degrees, true north being north in plan.

struct SunSite

pub struct SunSite

What the sun needs of the project’s site.

Traits: Debug, Clone, Copy, PartialEq, Default

Fields

Methods

enum SunInterval

pub enum SunInterval

The step between frames of a sun study.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

enum SunMode

pub enum SunMode

How a view places its sun.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize, Default

Variants

Methods

struct SunFrame

pub struct SunFrame

One moment of a sun study.

Traits: Debug, Clone, Copy, PartialEq

Fields

struct SunSettings

pub struct SunSettings

A view’s sun: how it is placed, the frame of a study shown, and what is drawn.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize, Default

Fields

Methods

struct SunState

pub struct SunState

Where a view’s sun stands, resolved.

Traits: Debug, Clone, Copy, PartialEq

Fields

fn view_forward

pub fn view_forward(view: &View) -> Option<DVec2>

The plan direction a view looks along, for a sun placed relative to it: a 3D view’s camera heading, an elevation’s or section’s look direction; None for plans and other views.

fn camera_forward

pub fn camera_forward(camera: &crate::CameraState) -> Option<DVec2>

The plan direction a 3D camera looks along (its heading); None when its yaw is not a number. A live camera the viewer turns places a sun relative to the view as the stored one does in view_forward.

struct SunPreset

pub struct SunPreset

A named sun setting the views can take.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

fn clean_preset_name

pub fn clean_preset_name(name: &str) -> Option<String>

A preset name: trimmed, cut to MAX_PRESET_NAME characters; None when empty.

fn repair_presets

pub fn repair_presets(presets: &mut Vec<SunPreset>) -> usize

Clean names, drop presets with no name or a name already taken, past MAX_PRESETS, and repair their modes; returns how many it fixed.

cc_core::sweep

crates/cc_core/src/sweep.rs

Sweeps and blends of component pieces. A sweep carries a closed profile along an open path drawn on one of the sketch planes: the profile’s u runs to the left of the path (in the path’s plane) and its v along the plane’s normal, and at each corner of the path the section is mitered (it lies in the plane that bisects the corner). A blend joins two closed outlines drawn on the same sketch plane at two positions along its normal (a bottom and a top), the faces between them ruled from points spaced evenly around each outline. Both come out as closed meshes with outward faces, in the component’s frame.

Items: path · sweep_closed · sweep · counter_clockwise · blend_section · blend · volume · eval_field

fn path

pub fn path(points: &[ProfilePoint], lookup: &dyn Fn(&str) -> Option<f64>) -> Result<Vec<DVec2>, ProfileError>

An open path of lines, arcs and parts of ellipses (a point’s radius makes the segment to the next point an arc, positive bulging to the right of travel; its ellipse a part of that ellipse).

fn sweep_closed

pub fn sweep_closed(plane: SketchPlane, path: &[DVec2], offset: f64, profile: &[DVec2]) -> Result<Vec<Vec<DVec3>>, ProfileError>

The solid of a counter-clockwise profile carried around the closed path (on plane, placed offset along its normal): mitered at every corner, the last point joined back to the first, with no end caps.

fn sweep

pub fn sweep(plane: SketchPlane, path: &[DVec2], offset: f64, profile: &[DVec2]) -> Result<Vec<Vec<DVec3>>, ProfileError>

The solid of a counter-clockwise profile carried along path (on plane, placed offset along its normal), mitered at the corners.

fn counter_clockwise

pub fn counter_clockwise(outline: &[DVec2]) -> Vec<DVec2>

outline in counter-clockwise order.

fn blend_section

pub fn blend_section(bottom: &[DVec2], top: &[DVec2], t: f64) -> Vec<DVec2>

The section of blend between counter-clockwise bottom and top at t (0 at the bottom, 1 at the top): its outlines resampled alike and joined point by point, as the blend’s faces are.

fn blend

pub fn blend(plane: SketchPlane, bottom: &[DVec2], top: &[DVec2], offset: f64, depth: f64) -> Result<Vec<Vec<DVec3>>, ProfileError>

The solid between a counter-clockwise bottom outline on plane at offset and a top outline depth farther along its normal.

fn volume

pub fn volume(faces: &[Vec<DVec3>]) -> f64

Signed volume of a closed mesh (for tests and checks).

fn eval_field

pub fn eval_field(field: &'static str, text: &str, lookup: &dyn Fn(&str) -> Option<f64>) -> Result<f64, ProfileError>

Evaluate an expression of a piece, naming the field on failure.

cc_core::template_spec

crates/cc_core/src/template_spec.rs

The sizes and names that differ between the metric and the imperial templates. crate::Project::from_template_system builds both from the same code and reads only these tables, so the two templates have the same types, views and ids, in the same order. Lengths are meters, except annotation sizes (paper millimeters); imperial values are written in inches or feet and kept exact multiples of 1/16”.

Items: Sized1 · Sized2 · Sized3 · SizedLibraryType · TemplateSpec · Defaults

type alias Sized1

pub(crate) type Sized1 = (&'static str, f64)

A name key and a value.

type alias Sized2

pub(crate) type Sized2 = (&'static str, f64, f64)

A name key and two values.

type alias Sized3

pub(crate) type Sized3 = (&'static str, f64, f64, f64)

A name key and three values.

type alias SizedLibraryType

pub(crate) type SizedLibraryType = (&'static str, &'static str, &'static [Sized1])

A library type whose name states a size: the library’s name key, the key used instead, and the parameters (keys) set to that size.

struct TemplateSpec

pub(crate) struct TemplateSpec

Fields

Methods

struct Defaults

pub struct Defaults

Sizes and rules that commands and tools give what they create outside the template, per measurement system (meters; see Defaults::of and crate::Project::defaults). The metric values are the ones these places always used; the imperial ones are round customary sizes.

Traits: Debug, Clone, PartialEq

Fields

Methods

cc_core::title_block

crates/cc_core/src/title_block.rs

Title blocks: components of kind ComponentKind::TitleBlock whose 2D pieces (ComponentDef::sheet) draw a whole sheet (border, title block, logo) in paper millimeters, origin at the paper’s bottom-left corner. Expressions read the parameters and SHEET_WIDTH and SHEET_HEIGHT; texts keep {fields} for the sheet to fill in.

Items: SHEET_WIDTH · SHEET_HEIGHT · MAX_SHEET_PIECES · MAX_STROKE_POINTS · MAX_SHEET_TEXT · MAX_SHEET_POINTS · DEFAULT_WEIGHT · MAX_TEXT_SIZE · STANDARD_KEY · standard · SheetItem · TextAnchor · SheetShape · MAX_NAME · SheetStroke · SheetText · SheetImage · SheetPieces · SheetNested · repair_def · MAX_FIELD_KEY · PROJECT_FIELD_PREFIX · project_field_name_ok · FieldPart · field_parts · rename_field_param · is_iso_date · parse_iso_date

const SHEET_WIDTH

pub const SHEET_WIDTH: &str

Name of the paper width (millimeters) in expressions.

const SHEET_HEIGHT

pub const SHEET_HEIGHT: &str

Name of the paper height (millimeters) in expressions.

const MAX_SHEET_PIECES

pub const MAX_SHEET_PIECES: usize

const MAX_STROKE_POINTS

pub const MAX_STROKE_POINTS: usize

const MAX_SHEET_TEXT

pub const MAX_SHEET_TEXT: usize

const MAX_SHEET_POINTS

pub const MAX_SHEET_POINTS: usize

Most points a title block’s strokes may have in all, once arcs are flattened.

const DEFAULT_WEIGHT

pub const DEFAULT_WEIGHT: f64

Pen width of a stroke without one, millimeters.

const MAX_TEXT_SIZE

pub const MAX_TEXT_SIZE: f64

Largest text height in millimeters (larger sizes are drawn at this one).

const STANDARD_KEY

pub const STANDARD_KEY: &str

Name key of the standard title block (component and type).

fn standard

pub fn standard(n: &dyn Fn(&str) -> String) -> ComponentDef

The title block every sheet had before title blocks were components: a border 10 mm in, and a 170 × 42 mm block in the bottom-right corner with the project, sheet and client rows and the sheet number cell. Captions are looked up by n (template keys tpl-tb-*).

struct SheetItem

pub struct SheetItem

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

enum TextAnchor

pub enum TextAnchor

Where a text’s position sits: on the baseline at its start, middle or end, or at its center.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

enum SheetShape

pub enum SheetShape

A 2D piece; every String is an expression in millimeters (degrees for rotations).

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Variants

Methods

const MAX_NAME

pub const MAX_NAME: usize

Most characters of a nested component’s name.

struct SheetStroke

pub struct SheetStroke

Traits: Debug, Clone, PartialEq

Fields

struct SheetText

pub struct SheetText

Traits: Debug, Clone, PartialEq

Fields

struct SheetImage

pub struct SheetImage

Traits: Debug, Clone, PartialEq

Fields

struct SheetPieces

pub struct SheetPieces

Traits: Debug, Clone, PartialEq, Default

Fields

struct SheetNested

pub struct SheetNested

A nested detail component, resolved: where its frame goes.

Traits: Debug, Clone, PartialEq

Fields

fn repair_def

pub fn repair_def(def: &mut ComponentDef) -> usize

Keep a definition’s pieces to its kind and within the limits: title blocks keep only sheet pieces, other kinds none. Returns the fixes.

const MAX_FIELD_KEY

pub const MAX_FIELD_KEY: usize

Most bytes a field key may have (a longer {…} is not a field).

const PROJECT_FIELD_PREFIX

pub const PROJECT_FIELD_PREFIX: &str

What a project field’s key starts with ({project:Name}).

fn project_field_name_ok

pub fn project_field_name_ok(name: &str) -> bool

Whether name can name a project field a text reads as {project:Name}: not blank, without braces, and short enough for the key to stay within MAX_FIELD_KEY.

enum FieldPart

pub enum FieldPart<'a>

A run of a title block text, as field_parts splits it.

Traits: Debug, Clone, Copy, PartialEq, Eq

Variants

fn field_parts

pub fn field_parts<'a>(text: &'a str, mut f: impl FnMut(FieldPart<'a>))

Splits text into words and {key} fields, in order: {{ and }} are literal braces, and a { closed by no } within MAX_FIELD_KEY bytes (before another {) is a brace like any other character.

fn rename_field_param

pub fn rename_field_param(text: &str, old: &str, new: &str) -> String

text with every {param:old} field reading {param:new}.

fn is_iso_date

pub fn is_iso_date(s: &str) -> bool

Whether s is a real YYYY-MM-DD date.

fn parse_iso_date

pub fn parse_iso_date(s: &str) -> Option<(i32, u32, u32)>

Year, month and day of a YYYY-MM-DD date: exactly four, two and two ASCII digits.

cc_core::topography

crates/cc_core/src/topography.rs

Terrain: a topography surface from measured points (x, y, z) inside a closed boundary drawn in plan. The geometry (cc_geom::topography) triangulates the points with the boundary, whose vertices take the elevation the points give them, and closes the surface down to a flat base base_depth below its lowest point, so sections cut the earth as a solid. Points outside the boundary are kept: they give the boundary its elevations but are not vertices of the surface.

Items: MAX_POINTS · MAX_OUTLINE · POINT_TOL · DEFAULT_BASE_DEPTH · DEFAULT_CONTOUR_INTERVAL · DEFAULT_MAJOR_EVERY · MIN_CONTOUR_INTERVAL · EARTH_COLOR · earth_material · Topography · clean_points

const MAX_POINTS

pub const MAX_POINTS: usize

Most measured points a topography keeps.

const MAX_OUTLINE

pub const MAX_OUTLINE: usize

Most points of a topography’s boundary.

const POINT_TOL

pub const POINT_TOL: f64

Points closer than this in plan are one point (the first is kept).

const DEFAULT_BASE_DEPTH

pub const DEFAULT_BASE_DEPTH: f64

Depth of the base below the lowest point, meters, unless given.

const DEFAULT_CONTOUR_INTERVAL

pub const DEFAULT_CONTOUR_INTERVAL: f64

Spacing of the contour lines of a new terrain type, meters.

const DEFAULT_MAJOR_EVERY

pub const DEFAULT_MAJOR_EVERY: u32

Every this many contours of a new terrain type, a major one.

const MIN_CONTOUR_INTERVAL

pub const MIN_CONTOUR_INTERVAL: f64

Smallest contour interval a terrain type keeps, meters.

const EARTH_COLOR

pub const EARTH_COLOR: [u8; 3]

Color of an earth material added for terrain.

fn earth_material

pub fn earth_material(p: &crate::Project) -> Option<&str>

The project’s earth material: the first of the earth class.

struct Topography

pub struct Topography

Traits: Debug, Clone, PartialEq, Serialize, Deserialize, Default

Fields

Methods

fn clean_points

pub fn clean_points(points: &[DVec3]) -> Vec<DVec3>

The finite points of points, the first of those that coincide in plan (within POINT_TOL), at most MAX_POINTS.

cc_core::transform

crates/cc_core/src/transform.rs

Rigid transforms in plan (move, rotate, mirror) applied to elements.

Items: PlanTransform

struct PlanTransform

pub struct PlanTransform

p ↦ R·M·p + t: an optional reflection across the X axis (M), a rotation by angle radians (R) and a translation t.

Traits: Debug, Clone, Copy, PartialEq, Default

Fields

Methods

cc_core::truss

crates/cc_core/src/truss.rs

Parametric trusses: a host element that holds the parameters of a plane truss (its span line, shape, height, web pattern, panels, member types and copies) and owns the ordinary beams (chords, diagonals) and columns (verticals) made from them, kept in step like a steel building’s (see crate::member_host). Members are laid out as they are built: each chord is one continuous beam per straight run (a gable’s top chord is two), verticals stand between the chords where their sections let them seat (inside a channel that opens toward the web, else on the chord’s face; see Sections), and where a truss ends on a vertical the chords run on over it and the one at the far end is turned around, so both ends are closed. Local coordinates: x along start → end (L long), the copies to the left of it every spacing, heights above the level from base_offset (the bottom chord’s axis).

Items: MAX_MEMBERS · MIN_VERTICAL · LENGTH · HEIGHT · PANELS · COPIES · SPACING · BASE_OFFSET · DEFAULT_LENGTH · DEFAULT_HEIGHT · DEFAULT_SPACING · PANEL_LENGTH · TrussShape · TrussPattern · TrussRoleKind · TrussRole · TrussMember · Truss · default_panels · host_type · Sections

const MAX_MEMBERS

pub const MAX_MEMBERS: usize

Most members one truss (all copies) may make; Truss::check refuses a truss whose layout would make more.

const MIN_VERTICAL

pub const MIN_VERTICAL: f64

A vertical shorter than this is skipped, and so is a diagonal whose ends differ less in height (it would lie on the bottom chord), meters.

const LENGTH

pub const LENGTH: RangeInclusive<f64>

const HEIGHT

pub const HEIGHT: RangeInclusive<f64>

const PANELS

pub const PANELS: RangeInclusive<u32>

const COPIES

pub const COPIES: RangeInclusive<u32>

const SPACING

pub const SPACING: RangeInclusive<f64>

const BASE_OFFSET

pub const BASE_OFFSET: RangeInclusive<f64>

The bottom chord’s axis above the level, meters.

const DEFAULT_LENGTH

pub const DEFAULT_LENGTH: f64

const DEFAULT_HEIGHT

pub const DEFAULT_HEIGHT: f64

const DEFAULT_SPACING

pub const DEFAULT_SPACING: f64

const PANEL_LENGTH

pub const PANEL_LENGTH: f64

The panel length the default panel count aims at, meters.

enum TrussShape

pub enum TrussShape

The outline of the truss: chords parallel, the top chord rising toward the end (mono), or toward mid-span from both supports (gable).

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

enum TrussPattern

pub enum TrussPattern

The web between the chords.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

enum TrussRoleKind

pub enum TrussRoleKind

What a member is in its truss.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize

Variants

Methods

struct TrussRole

pub struct TrussRole

A member’s place: its kind, its copy and its index there (chords: the straight run, 0 or, past a gable’s apex, 1; verticals: the panel point; diagonals: their place in the pattern).

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize

Fields

Methods

struct TrussMember

pub struct TrussMember

A member the truss manages.

Traits: Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize

Fields

struct Truss

pub struct Truss

Traits: Debug, Clone, PartialEq, Serialize, Deserialize, MemberHost

Fields

Methods

fn default_panels

pub fn default_panels(length: f64, shape: TrussShape) -> u32

About one panel per PANEL_LENGTH, 2 to 64, even on a gable.

fn host_type

pub fn host_type(id: ElementTypeId, name: String) -> ElementType

The type a project gets with its first truss.

struct Sections

pub struct Sections

What a layout needs to know of the member types’ sections, in meters. The default (all zero) lays members out axis to axis.

Traits: Debug, Clone, Copy, PartialEq, Default

Fields

Methods

cc_core::types

crates/cc_core/src/types.rs

Items: Category · LayerFunction · Layer · WallFunction · TypeInfo · TypeData · default_cut_slope · default_fill_slope · default_contour_interval · default_major_every · ColumnSection · SectionShape · FoundationKind · StripHaunch · ElementType · stair_layout

enum Category

pub enum Category

BIM category of an element or element type.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize

Variants

Methods

enum LayerFunction

pub enum LayerFunction

Role of a layer in a compound type. The core (structure layers) is the reference for core-based wall location lines.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct Layer

pub struct Layer

One material layer of a compound wall/floor/roof type, listed exterior first.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

enum WallFunction

pub enum WallFunction

Purpose of a wall type.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct TypeInfo

pub struct TypeInfo

Descriptive data shared by all instances of a type.

Traits: Debug, Clone, PartialEq, Default, Serialize, Deserialize

Fields

enum TypeData

pub enum TypeData

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Variants

Methods

fn default_cut_slope

pub(crate) fn default_cut_slope() -> f64

fn default_fill_slope

pub(crate) fn default_fill_slope() -> f64

fn default_contour_interval

pub(crate) fn default_contour_interval() -> f64

fn default_major_every

pub(crate) fn default_major_every() -> u32

enum ColumnSection

pub enum ColumnSection

Cross-section of a column type.

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize

Variants

Methods

enum SectionShape

pub enum SectionShape

What fills a section’s width x depth box. Profiles are laid out as in steel tables: the web of an I or channel runs along the depth, the legs of an angle lie on the left and bottom sides of the box, and the flanges of a channel point to the right.

Traits: Debug, Clone, Copy, PartialEq, Default, Serialize, Deserialize

Variants

Methods

enum FoundationKind

pub enum FoundationKind

What a foundation type is: a pad under a column, a strip under a wall, a slab, or a cap on piles (see crate::pile).

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

struct StripHaunch

pub struct StripHaunch

The section of a strip footing with a beam on top (an inverted T): the footing slab is the type’s thickness deep at the faces of the beam and edge_thickness at its edges, its top sloping between them (a haunch; flat when the two are equal), and the beam beam_width wide rises beam_height above the slab (0: a sloped footing with a flat middle).

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize

Fields

Methods

struct ElementType

pub struct ElementType

An element type: the shared parameters of a group of instances.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

fn stair_layout

pub fn stair_layout(height: f64, max_riser: f64, tread: f64) -> (usize, f64, f64)

Riser count, riser height and run length of a straight stair of height with at most max_riser per riser and tread-deep treads (one tread fewer than risers: the last riser lands on the upper floor).

cc_core::units

crates/cc_core/src/units.rs

Project units: how lengths, areas, volumes, angles, slopes and money are displayed and typed. Values in the model stay in meters and degrees; these settings only affect presentation.

Items: INCH · FOOT · MeasurementSystem · inch_text · round_imperial · LengthUnit · AreaUnit · VolumeUnit · SlopeUnit · NumberStyle · MAX_DECIMALS · Format · Units

const INCH

pub const INCH: f64

Meters in an inch (exact, by definition).

const FOOT

pub const FOOT: f64

Meters in a foot (exact, by definition).

enum MeasurementSystem

pub enum MeasurementSystem

The system a project measures in: what its template sizes its types in and what its units show. Not stored: a project is imperial when its length unit is (see Units::system).

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default

Variants

Methods

fn inch_text

pub fn inch_text(meters: f64) -> String

A length in inches with sixteenths as a fraction, with the inch mark: 8", 6 1/2", 5/16" (rounded to the nearest sixteenth).

fn round_imperial

pub fn round_imperial(meters: f64) -> f64

A metric size turned into a round imperial one: the nearest inch up to a foot, else the nearest 6” (0.1 m is 4”, 0.6 m 2’-0”, 2.4 m 8’-0”).

enum LengthUnit

pub enum LengthUnit

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

enum AreaUnit

pub enum AreaUnit

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

enum VolumeUnit

pub enum VolumeUnit

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

enum SlopeUnit

pub enum SlopeUnit

How slopes (rise over run) are shown.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

enum NumberStyle

pub enum NumberStyle

Decimal symbol and digit grouping.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

const MAX_DECIMALS

pub const MAX_DECIMALS: u8

Most decimals any unit may show.

struct Format

pub struct Format<U>

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize

Fields

struct Units

pub struct Units

Display settings for every kind of quantity.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize, Default

Fields

Methods

cc_core::view

crates/cc_core/src/view.rs

Items: ViewCategory · Direction · CameraState · MIN_PAPER_MM · MAX_PAPER_MM · SheetSize · Viewport · ViewKind · View · ShadingSettings · VisualStyle · DetailLevel · MAX_SECTION_SEGMENT · MepDiscipline · Underlay · UnderlayPlan · UnderlayLevel · Looking

enum ViewCategory

pub enum ViewCategory

Grouping used by the Project Browser.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize

Variants

Methods

enum Direction

pub enum Direction

Elevation direction, named by the side the viewer stands on.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize

Variants

Methods

struct CameraState

pub struct CameraState

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Default

Fields

Methods

const MIN_PAPER_MM

pub const MIN_PAPER_MM: f64

Smallest and largest side of a custom sheet, millimeters.

const MAX_PAPER_MM

pub const MAX_PAPER_MM: f64

enum SheetSize

pub enum SheetSize

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize

Variants

Methods

struct Viewport

pub struct Viewport

A view placed on a sheet.

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

enum ViewKind

pub enum ViewKind

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Variants

Methods

struct View

pub struct View

Traits: Debug, Clone, PartialEq, Serialize, Deserialize

Fields

Methods

struct ShadingSettings

pub struct ShadingSettings

How a view shades faces and casts shadows in the styles that show more than white faces (shaded, consistent colors, textures), in 2D and in the 3D view (not in photorealistic renders). The defaults are the look of VisualStyle::shaded_grey and VisualStyle::SHADED_SHADOW.

Traits: Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Default

Fields

Methods

enum VisualStyle

pub enum VisualStyle

How a view shows the model’s surfaces.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

enum DetailLevel

pub enum DetailLevel

How much a view draws of elements: at Coarse, layered walls, floors and roofs are cut as one region with a plain fill (no layers, no material patterns); at Medium and Fine they show their layers and patterns. Component pieces show at the levels they are set for (crate::component::DetailLevels), so a component can draw a simple shape at Coarse and its details at Fine.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

const MAX_SECTION_SEGMENT

pub const MAX_SECTION_SEGMENT: f64

Longest piece of a split section line kept next to a head, meters.

enum MepDiscipline

pub enum MepDiscipline

The building services shown by a services plan.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize

Variants

Methods

struct Underlay

pub struct Underlay

Other levels’ plans drawn halftone under a floor or ceiling plan, for reference while drawing: a plan below and one above, each seen looking down (as a floor plan) or up (as a ceiling plan). They are not picked, selected or snapped to, and are printed only when printed.

Traits: Debug, Clone, Copy, PartialEq, Default, Serialize, Deserialize

Fields

Methods

struct UnderlayPlan

pub struct UnderlayPlan

One plan shown under a view: which level, and from which side.

Traits: Debug, Clone, Copy, PartialEq, Default, Serialize, Deserialize

Fields

enum UnderlayLevel

pub enum UnderlayLevel

The level of an underlay: the next one (below or above the view’s level, so a template works for every level), or a given level.

Traits: Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize

Variants

enum Looking

pub enum Looking

Which way a plan looks: down (a floor plan) or up (a ceiling plan).

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

cc_core::wall_framing

crates/cc_core/src/wall_framing.rs

Light steel and wood framing of walls: a host element attached to one straight wall that owns ordinary columns (studs, king and jack studs, cripples) and beams (tracks or plates, headers, sills, blocking) laid out from its parameters, its wall and the doors and windows the wall hosts. They are kept in step like a steel building’s members (see crate::member_host), and any change of the wall or its openings regenerates them. The wall frame: u along the wall’s body centerline (Project::wall_axis) from its start to its length L, heights above the wall’s level.

Items: MAX_MEMBERS · MIN_PIECE · END_STUD · SPACING · LIGHT_STEEL_SPACING · WOOD_SPACING · FramingSystem · FramingRoleKind · FramingRole · FramingMember · WallFraming · host_type

const MAX_MEMBERS

pub const MAX_MEMBERS: usize

Most members one framing makes; the layout stops there.

const MIN_PIECE

pub const MIN_PIECE: f64

A jack, cripple or blocking piece shorter than this is left out, meters.

const END_STUD

pub const END_STUD: u16

The index of the stud at the wall’s end (its key does not depend on the length).

const SPACING

pub const SPACING: RangeInclusive<f64>

const LIGHT_STEEL_SPACING

pub const LIGHT_STEEL_SPACING: f64

const WOOD_SPACING

pub const WOOD_SPACING: f64

enum FramingSystem

pub enum FramingSystem

How the wall is framed.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize

Variants

Methods

enum FramingRoleKind

pub enum FramingRoleKind

What a member is in its framing.

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize

Variants

Methods

struct FramingRole

pub struct FramingRole

A member’s place in its framing:

Traits: Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize

Fields

Methods

struct FramingMember

pub struct FramingMember

A member the framing manages.

Traits: Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize

Fields

struct WallFraming

pub struct WallFraming

Traits: Debug, Clone, PartialEq, Serialize, Deserialize, MemberHost

Fields

Methods

fn host_type

pub fn host_type(id: ElementTypeId, name: String) -> ElementType

The type a project gets with its first wall framing.

cc_core::wall_ops

crates/cc_core/src/wall_ops.rs

Geometry edits of linear elements (walls, beams, grids): trim or extend to a corner or to a reference line, split, offset and align. Arc walls take part on their circle: they trim and extend along it, and meet lines and other arcs where the circles cross. Picks are plan points on the element: the picked part is the part kept. Detail lines take part too, through their curve and crate::sketch_edit: they trim and extend to other detail lines and to the lines of walls, beams and grids, split and offset.

Items: Path · path_of · curve_of · line_of · connected_ends · EditError · path

enum Path

pub enum Path

Where a linear element runs: a straight line, or an arc (arc walls and arc beams).

Traits: Debug, Clone, Copy, PartialEq

Variants

fn path_of

pub fn path_of(e: &Element) -> Option<Path>

The path of a linear element, if it has one.

fn curve_of

pub fn curve_of(e: &Element) -> Option<SketchCurve>

The curve of an element as a sketch curve: a detail line’s own, or the location line of a wall or beam (an arc for arc walls and arc beams) or grid.

fn line_of

pub fn line_of(e: &Element) -> Option<(DVec2, DVec2)>

Location line of a linear element, if it has one.

fn connected_ends

pub fn connected_ends(project: &Project, id: ElementId, point: DVec2) -> Vec<(ElementId, bool)>

Ends of other walls on the same level that meet point (within 1 cm), as (wall, is_start).

enum EditError

pub enum EditError

Why an edit could not be made.

Traits: Debug, Clone, Copy, PartialEq, Eq

Variants

fn path

pub fn path(project: &Project, id: ElementId) -> Result<Path, EditError>

The path of an element (line or arc).