-
Notifications
You must be signed in to change notification settings - Fork 1
Code Design
Iris edited this page Mar 15, 2025
·
1 revision
In this section I discuss the structure and design of Voxircle's code, mostly for myself.
List of objects (traits, structs, and enums)
-
Shape<Alg, Params>: trait abstracting a class of shapes that can be configured by a set of parameters. Objects implementing this trait may carry some parameters that (globally) configure how the slider/code set the parameters-
Squircle: object implementingShape<SquircleAlgorithm, SquircleParams>. Carriessingle_radius: boolthat says whether or not both the major and minor radii of the squircle should be the same (this is reflected in how the slider/code look and work)-
SquircleParams: struct carrying all the parameters that define a squircle -
SquircleAlgorithm: enum of all the algorithms that voxilize the squircle (possibly carrying additional configuration options, such as forPercentage)
-
-
Line(not implemented)
-
-
LayerParameters: all data required for generating a single layer. Contains:- One
SquircleAlgorithmwhich is run on all of -
Vec<SquircleParams>, which come from sliders (in no-code case) or sampling the rhai code fields
- One
-
Blocks: struct encoding a voxelization, is the output of a generation algorithm -
ParamField: A parameter field, which is a slider with a code field. Also does its own (more or less modular) UI and samplingFieldState
- math: objects with algorithms especially for the generation of Blocks
Vec2Mat2OrientationSquare
-
Metrics: struct containing all metrics (such asnr_blocks, etc.)- SparseBlocks: struct encoding a voxelization, is used in metrics (esp. the boundary)
- SymmetryType: enum of the symmetry type
-
AppControlSampleCombineMethodSampleDistributeMethodZVecView