Following discussion on #455, this removes RectClip from our API, as it does not provide the same guarantees that Clipper2's regular boolean clipping operations give us (that make sure that CrossSections can be extruded successfully).
Also, this fixes AsCrossSection which was returning empty CrossSections due to incorrect winding followed by a Positive fill rule union operation. Now it is working as advertised, while skipping over the needless clipping by implementing it as a CrossSection constructor (building a PathsD directly).
* enabled test
* remove test
* test infinite loops
* test infinite loops
* reduced test
* update volume
* fixed RemoveIfFolded
* rename test
* allow degenerates
Only link MeshIO in C bindings when `MANIFOLD_EXPORT` is defined. MeshIO related code has been better consolidated to limit the number of `#ifdef` blocks required.
* js binding for triangulation
* don't use CrossSection class as it alters the order of the vertices
* remove unused code,
rename original Triangulate to TriangulateIdx,
move TriangulateJS from bindings.cpp to polygon.cpp,
rename TrinagulateJS to Triangulate for consistent C++ and JS API,
add optional precision parameter
Add `InvalidConstruction` to `Manifold::Error` and return empty manifolds with it set when manifold construction is attempted with invalid parameters
- zero / negative dimensions for Cube
- zero / negative radius for Sphere
- zero / negative height for Extrude
- empty CrossSection for Extrude/Revolve
Also, Circle and Square have been updated to return empty CrossSections for similar arguments.
- Add bindings to `CrossSection::{Compose,Decompose,NumVert,NumContour,Warp}`
- Add bindings to `Boolean` and `BatchBoolean` for both `Manifold` and `CrossSection`
- Add `ManifoldManifoldVec` and `ManifoldCrossSectionVec` opaque types for `std::vector` pointers to help clean up bindings involving vectors (particularly when they are returned with dynamic size, *e.g.* `manifold_decompose`
- Remove two-step Components workaround previously introduced to allow return of C array from `manifold_decompose`
Decompose breaks a CrossSection into independent complex polygons.
Compose implemented as a batch union (preserving the CrossSection guaranteed lack of intersections).
* Flatten the CsgOpNodes as we build them, rather than in GetChildren
* Don't inline reused nodes in CsgNode::Boolean
* Reinstate difference -> union rewrite
* No need for opportunistic flattening anymore
* Fix typo
* Remove CsgOpNode::Impl::simplified_
* Don't overskip referenced nodes in simplification
* Avoid needless copy of shared pointers
* Disambiguate CsgOpNode::Impl::flatten_ -> forcedToLeafNodes_ and align GetChildren arg naming
* Simplified CsgOpNode::GetChildren
* Simpler (a-(b+c)) -> (a-b-c) transform in CsgOpNode::Boolean to work better w/ CsgOpNode::ToLeafNode
* Simpler build hints for large_scene_test.cpp
* [flatten] Refine rules about tree flattening + added test case
* [manifold] Propagate transforms when flattening op trees
* [flatten] move tests from manifold_test to boolean_test
Break out the MeshIO library from the tests subdirectory, and make building the tests optional. In cases where building/re-building the tests is not wanted/needed, this can shorten build times by over 25% on my machine. A major motivator for this is building 3rd party bindings.
Also included here are descriptors for the option declarations, which I
noticed do not actually set the default value as expected if the
description argument is omitted (defaults to OFF, rather than ON for
`_TEST` and `_PYBIND` for example).
* + CrossSection and Rect type interfaces and method functions
* `manifold_extrude` and `manifold_revolve` take `ManifoldCrossSection*`
* fix manifoldc extrude test (`ManifoldCrossSection*` argument)
* WIP Clipper2 wrapper for 2d subsystem
* Working example in clippoly_test
* Add clean_ property to clippoly
* Square center=false by default
* Square defaults to center=false
* Shorten union example
* + simplification and minkowski functions
* + Circle and note on Minkowski
* + Offset (InflatePaths)
* Clippoly -> CrossSection renaming
* Switch from NonZero to Positive fill rule
* -(minkowski, simplifs, clean_) + pre-alloc vecs
Remove minkowski, simplification algorithms other than simplify,
clean (union) arbitrary contours on construction, and pre-allocate
vectors when length is known.
* - index from polygon conversion + missed vec prealloc
* Use Polygon shorthand over std::vector
* Update copyright date
* Add Rotate
* Update copyrights to 2023
* Extrude and Revolve accept CrossSection only
* Fix incorrect use of vector constructor
* Fix remaining incorrect vector construction
* Revert "Update copyrights to 2023"
This reverts commit af8f6c8c95135eb3376e1f150fe720fddea16f33.
* Re-update copyright notice in cross_section files
* Add missing precision_ argument to cleaning Unions
* Lift circular resolution globals into Quality
* Replace uses of Manifold globals with Quality
* + Ellipse, Mirror, Area
* Include mirror in Union example and test area
* + Rewind (reverse winding of all contours)
* + fillrule/IsEmpty - Ellipse/Rewind
* Move Quality into public.h
* Remove bad definition
* Replace manual circles with CrossSection::Circle
* Lists of empty contours are empty
* + Rect class, RectClip, + const params/methods
* Add Transform to CrossSection and Rect
* include all transforms
* added show method for editor debug
* await before cleanup
* tighten JS tests
* move out common test functions
* split manifold and boolean tests
* cleanup
* tighten samples tests
* fixed GetMeshGL
* fixed original IDs for empty runs
* link SDF
* update CUDA files
* revert accidentally-removed test function
* added types and docs
* Added missing JS bindings (from discussion in #317)
* Fix formatting
* Add reserveIDs JS bindings
* Use numRun instead of numMatrix
* Make numProp, triVerts and vertProperties required options in Mesh ctor.
* Rename MeshJS originalID to runOriginalID, and transform to runTransform
* Fix formatting with clang-format
* Trigger CI
* Added missing C bindings
* Rename matrix to transform in JS type definitions
* Rename numMatrix to numRun in JS type defs
almost forgot this one again
* JS bindings, transform index -> run
* removed BufferGeometryUtils
* replaced three.js with gltf-transform
* textured sphere working
* added cubeUV
* added textures
* added relation and sorting to MeshGL
* working textures example!
* added faceID
* removed MeshRelation
* some more removal
* fix output for no properties
* test cleanup
* Add new MeshGL accessors (replacing MeshRelation) (#311)
+ new meshgl accessors + remove mesh_relation_size
* removed meshID from public API
* added input checking for MeshGL
* remove C api
---------
Co-authored-by: Geoff deRosenroll <geoffderosenroll@gmail.com>
sqrtf to return float rather than double
This hasn't been a problem on my machine, or in the Manifold CI, but
the double <> float mismatch gave a type error in an ubuntu 22.04
workflow on my omanifold project. Not totally sure why as of yet, but
this gets rid of the implicit conversion at the root of it.