v0.3.9
Pre-release
Pre-release
This release fixes a bunch of small issues encountered while building a design tool on top of the Fidget kernel.
- Fix panic in tape construction if a multi-output expression has a constant as an output.
- Add
Function::can_simplifyto check whether aFunctioncan ever be simplified (if not, then interval evaluation isn't as useful). - Fix invalid access when doing bulk evaluation on a
Functionwith more than one output. This caused a panic using the VM evaluator, and a segfault (typically) using the JIT evaluator. - Make
PartialEqforTreeobjects do deep comparisons, instead of shallow (pointer) equality- This is more expensive, but matches typical data structures in Rust
Tree::ptr_eqcan be used to perform shallow equality checks
- Changed 3D image rendering to saturate when voxels are touching the camera. Saturated voxels snap to the image's depth and have a normal of
[0, 0, 1]. - Replaced
viewinImageRenderConfig,VoxelRenderConfig, andmesh::Settingswith a genericworld_to_modelmatrix, for more flexibility when rendering. - Add mathematical constants for Rhai scripts (
PI,E,TAU...) - Add
std::ops::Negimplementation forVec2,3,4types, in both Rust and Rhai. - Remove
Shape::apply_transform; there were too many ways to apply transforms to shapes, and having mutable operations on a handle passed byCloneopens up possibilities for confusion. Here's the new plan:- When using high-level algorithms (e.g. meshing and rendering), the world-to-model transform is now only set by the
world_to_modelmatrix in the config or settings object (ImageRenderConfig,VoxelRenderConfig,mesh::Settings) - When using a
Shapedirectly, a transform can be set withShape::with_transform. This returns a newShape<F, Transformed>, whereTransformedis a marker type indicating that the transform field isSome(..).Shape::with_transformis a one-way operation: it's only available onShape<F>(which is actually nowShape<F, ()>). Note that high-level operations require aShape<F, ()>, because they set the transform themselves!
- When using high-level algorithms (e.g. meshing and rendering), the world-to-model transform is now only set by the
- Add
vec2([..])andvec3([..])functions to Rhai environment - Fix
remap_affinecomposition; previously, it applied operations in the wrong order given multiple affine transformations. - New shapes:
Rectangle,Box,Rotate(X|Y|Z),Blend,Plane,ScaleUniform,RevolveY,ExtrudeZ,LoftZ - Added ordered constructors to Rhai bindings, e.g.
rectangle([0,0], [1,1]). These are only available if a previous constructor didn't use the same function prototype. - Added
cancel: CancelTokentofidget::mesh::SettingsOctree::buildnow returns anOption<..>, which isNoneif it was cancelled
- Removed
SettingsfromOctree::walk_dual, because we aren't actually doing any multithreading - Switched various mesh functions to take
Settingsby reference instead of by value, becauseCancelTokenis notCopy. - Make Rhai
vec2(..)andvec3(..)functions idempotent, i.e.vec2(vec2(..))now works. - Optimize
atan2interval evaluation