Skip to content

v0.3.9

Pre-release
Pre-release

Choose a tag to compare

@mkeeter mkeeter released this 01 Sep 19:31
· 109 commits to main since this release
cc68659

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_simplify to check whether a Function can ever be simplified (if not, then interval evaluation isn't as useful).
  • Fix invalid access when doing bulk evaluation on a Function with more than one output. This caused a panic using the VM evaluator, and a segfault (typically) using the JIT evaluator.
  • Make PartialEq for Tree objects do deep comparisons, instead of shallow (pointer) equality
    • This is more expensive, but matches typical data structures in Rust
    • Tree::ptr_eq can 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 view in ImageRenderConfig, VoxelRenderConfig, and mesh::Settings with a generic world_to_model matrix, for more flexibility when rendering.
  • Add mathematical constants for Rhai scripts (PI, E, TAU...)
  • Add std::ops::Neg implementation for Vec2,3,4 types, 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 by Clone opens 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_model matrix in the config or settings object (ImageRenderConfig, VoxelRenderConfig, mesh::Settings)
    • When using a Shape directly, a transform can be set with Shape::with_transform. This returns a new Shape<F, Transformed>, where Transformed is a marker type indicating that the transform field is Some(..). Shape::with_transform is a one-way operation: it's only available on Shape<F> (which is actually now Shape<F, ()>). Note that high-level operations require a Shape<F, ()>, because they set the transform themselves!
  • Add vec2([..]) and vec3([..]) functions to Rhai environment
  • Fix remap_affine composition; 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: CancelToken to fidget::mesh::Settings
    • Octree::build now returns an Option<..>, which is None if it was cancelled
  • Removed Settings from Octree::walk_dual, because we aren't actually doing any multithreading
  • Switched various mesh functions to take Settings by reference instead of by value, because CancelToken is not Copy.
  • Make Rhai vec2(..) and vec3(..) functions idempotent, i.e. vec2(vec2(..)) now works.
  • Optimize atan2 interval evaluation