Allows a developer to pass some context to the level set function in the C FFI bindings, such as a pointer to an object in the host language, so that parallel calls can be threadsafe.
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).
* Added more Python bindings (CrossSection) and some clarifying Python examples on how to create polygons etc
* Returned extrude from Python example and renamed accordingly.
* Removed PolygonWrapper class from Python bindings
- add CrossSection class
- move static method (constructors) under their respective classes
-add Manifold.{split, splitByPlane}
- enable usage of instanceof on Manifold (and now CrossSection) objects simplify registry indirection in worker.ts, enabling method de-structuring (opening static function names out of class module name-spaces)
Build changes:
- break C++ helpers out from bindings.cpp to helpers.cpp
- ensure that ts files are copied during builds even when nothing is recompiled
Note that in addition to the new bindings, the most of the existing toplevel functions have been moved under their respective classes as static methods (breaking change!). I haven't added any new examples yet, but the existing ones are passing and do make use of CrossSection now (some transparently, and some directly), but I think enough of this is together that review is worthwhile.
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`
* + 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
* Properly encapsulate ES6 type defs. in module
* Fixed import file name typo
* Copy type definitions to editor folder (not used for now)
* Dummy commit (trigger CI)