Skip to content

Commit

Permalink
Merge branch 'master' into emscripten-tbb
Browse files Browse the repository at this point in the history
  • Loading branch information
pca006132 committed Nov 16, 2024
2 parents 6f1189d + 0b957bf commit 8e3807e
Show file tree
Hide file tree
Showing 13 changed files with 522 additions and 134 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,6 @@ message(STATUS "BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}")
message(STATUS " ")
message(STATUS "MANIFOLD_PAR: ${MANIFOLD_PAR}")
message(STATUS "MANIFOLD_CROSS_SECTION: ${MANIFOLD_CROSS_SECTION}")
message(STATUS "MANIFOLD_FLAGS: ${MANIFOLD_FLAGS}")
message(STATUS "MANIFOLD_EXPORT: ${MANIFOLD_EXPORT}")
message(STATUS "MANIFOLD_TEST: ${MANIFOLD_TEST}")
message(STATUS "MANIFOLD_FUZZ: ${MANIFOLD_FUZZ}")
Expand All @@ -383,6 +382,7 @@ message(STATUS "MANIFOLD_CBIND: ${MANIFOLD_CBIND}")
message(STATUS "MANIFOLD_PYBIND: ${MANIFOLD_PYBIND}")
message(STATUS "MANIFOLD_JSBIND: ${MANIFOLD_JSBIND}")
message(STATUS "MANIFOLD_EXCEPTIONS: ${MANIFOLD_EXCEPTIONS}")
message(STATUS "MANIFOLD_FLAGS: ${MANIFOLD_FLAGS}")
message(STATUS " ")

# If it's an EMSCRIPTEN build, we're done
Expand Down
15 changes: 8 additions & 7 deletions bindings/c/include/manifold/manifoldc.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@ ManifoldMeshGL *manifold_meshgl_merge(void *mem, ManifoldMeshGL *m);

ManifoldMeshGL64 *manifold_meshgl64(void *mem, double *vert_props,
size_t n_verts, size_t n_props,
size_t *tri_verts, size_t n_tris);
uint64_t *tri_verts, size_t n_tris);

ManifoldMeshGL64 *manifold_meshgl64_w_tangents(void *mem, double *vert_props,
size_t n_verts, size_t n_props,
size_t *tri_verts, size_t n_tris,
uint64_t *tri_verts,
size_t n_tris,
double *halfedge_tangent);
ManifoldMeshGL64 *manifold_get_meshgl64(void *mem, ManifoldManifold *m);
ManifoldMeshGL64 *manifold_meshgl64_copy(void *mem, ManifoldMeshGL64 *m);
Expand Down Expand Up @@ -406,13 +407,13 @@ size_t manifold_meshgl64_run_transform_length(ManifoldMeshGL64 *m);
size_t manifold_meshgl64_face_id_length(ManifoldMeshGL64 *m);
size_t manifold_meshgl64_tangent_length(ManifoldMeshGL64 *m);
double *manifold_meshgl64_vert_properties(void *mem, ManifoldMeshGL64 *m);
size_t *manifold_meshgl64_tri_verts(void *mem, ManifoldMeshGL64 *m);
size_t *manifold_meshgl64_merge_from_vert(void *mem, ManifoldMeshGL64 *m);
size_t *manifold_meshgl64_merge_to_vert(void *mem, ManifoldMeshGL64 *m);
size_t *manifold_meshgl64_run_index(void *mem, ManifoldMeshGL64 *m);
uint64_t *manifold_meshgl64_tri_verts(void *mem, ManifoldMeshGL64 *m);
uint64_t *manifold_meshgl64_merge_from_vert(void *mem, ManifoldMeshGL64 *m);
uint64_t *manifold_meshgl64_merge_to_vert(void *mem, ManifoldMeshGL64 *m);
uint64_t *manifold_meshgl64_run_index(void *mem, ManifoldMeshGL64 *m);
uint32_t *manifold_meshgl64_run_original_id(void *mem, ManifoldMeshGL64 *m);
double *manifold_meshgl64_run_transform(void *mem, ManifoldMeshGL64 *m);
size_t *manifold_meshgl64_face_id(void *mem, ManifoldMeshGL64 *m);
uint64_t *manifold_meshgl64_face_id(void *mem, ManifoldMeshGL64 *m);
double *manifold_meshgl64_halfedge_tangent(void *mem, ManifoldMeshGL64 *m);

// memory size
Expand Down
15 changes: 8 additions & 7 deletions bindings/c/manifoldc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ ManifoldMeshGL *manifold_meshgl_w_tangents(void *mem, float *vert_props,

ManifoldMeshGL64 *manifold_meshgl64(void *mem, double *vert_props,
size_t n_verts, size_t n_props,
size_t *tri_verts, size_t n_tris) {
uint64_t *tri_verts, size_t n_tris) {
auto mesh = new (mem) MeshGL64();
mesh->numProp = n_props;
mesh->vertProperties = vector_of_array(vert_props, n_verts * n_props);
Expand All @@ -375,7 +375,8 @@ ManifoldMeshGL64 *manifold_meshgl64(void *mem, double *vert_props,

ManifoldMeshGL64 *manifold_meshgl64_w_tangents(void *mem, double *vert_props,
size_t n_verts, size_t n_props,
size_t *tri_verts, size_t n_tris,
uint64_t *tri_verts,
size_t n_tris,
double *halfedge_tangent) {
auto mesh = new (mem) MeshGL64();
mesh->numProp = n_props;
Expand Down Expand Up @@ -587,16 +588,16 @@ size_t manifold_meshgl64_tangent_length(ManifoldMeshGL64 *m) {
double *manifold_meshgl64_vert_properties(void *mem, ManifoldMeshGL64 *m) {
return copy_data(mem, from_c(m)->vertProperties);
}
size_t *manifold_meshgl64_tri_verts(void *mem, ManifoldMeshGL64 *m) {
uint64_t *manifold_meshgl64_tri_verts(void *mem, ManifoldMeshGL64 *m) {
return copy_data(mem, from_c(m)->triVerts);
}
size_t *manifold_meshgl64_merge_from_vert(void *mem, ManifoldMeshGL64 *m) {
uint64_t *manifold_meshgl64_merge_from_vert(void *mem, ManifoldMeshGL64 *m) {
return copy_data(mem, from_c(m)->mergeFromVert);
}
size_t *manifold_meshgl64_merge_to_vert(void *mem, ManifoldMeshGL64 *m) {
uint64_t *manifold_meshgl64_merge_to_vert(void *mem, ManifoldMeshGL64 *m) {
return copy_data(mem, from_c(m)->mergeToVert);
}
size_t *manifold_meshgl64_run_index(void *mem, ManifoldMeshGL64 *m) {
uint64_t *manifold_meshgl64_run_index(void *mem, ManifoldMeshGL64 *m) {
return copy_data(mem, from_c(m)->runIndex);
}
uint32_t *manifold_meshgl64_run_original_id(void *mem, ManifoldMeshGL64 *m) {
Expand All @@ -605,7 +606,7 @@ uint32_t *manifold_meshgl64_run_original_id(void *mem, ManifoldMeshGL64 *m) {
double *manifold_meshgl64_run_transform(void *mem, ManifoldMeshGL64 *m) {
return copy_data(mem, from_c(m)->runTransform);
}
size_t *manifold_meshgl64_face_id(void *mem, ManifoldMeshGL64 *m) {
uint64_t *manifold_meshgl64_face_id(void *mem, ManifoldMeshGL64 *m) {
return copy_data(mem, from_c(m)->faceID);
}
double *manifold_meshgl64_halfedge_tangent(void *mem, ManifoldMeshGL64 *m) {
Expand Down
12 changes: 6 additions & 6 deletions bindings/python/manifold3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,19 +597,19 @@ NB_MODULE(manifold3d, m) {
"__init__",
[](MeshGL64 *self,
nb::ndarray<double, nb::shape<-1, -1>, nb::c_contig> &vertProp,
nb::ndarray<size_t, nb::shape<-1, 3>, nb::c_contig> &triVerts,
const std::optional<nb::ndarray<size_t, nb::shape<-1>,
nb::ndarray<uint64_t, nb::shape<-1, 3>, nb::c_contig> &triVerts,
const std::optional<nb::ndarray<uint64_t, nb::shape<-1>,
nb::c_contig>> &mergeFromVert,
const std::optional<nb::ndarray<uint64_t, nb::shape<-1>,
nb::c_contig>> &mergeToVert,
const std::optional<
nb::ndarray<size_t, nb::shape<-1>, nb::c_contig>> &mergeToVert,
const std::optional<
nb::ndarray<size_t, nb::shape<-1>, nb::c_contig>> &runIndex,
nb::ndarray<uint64_t, nb::shape<-1>, nb::c_contig>> &runIndex,
const std::optional<nb::ndarray<uint32_t, nb::shape<-1>,
nb::c_contig>> &runOriginalID,
std::optional<nb::ndarray<double, nb::shape<-1, 4, 3>,
nb::c_contig>> &runTransform,
const std::optional<
nb::ndarray<size_t, nb::shape<-1>, nb::c_contig>> &faceID,
nb::ndarray<uint64_t, nb::shape<-1>, nb::c_contig>> &faceID,
const std::optional<nb::ndarray<double, nb::shape<-1, 3, 4>,
nb::c_contig>> &halfedgeTangent,
float tolerance) {
Expand Down
13 changes: 8 additions & 5 deletions include/manifold/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ namespace manifold {
* @brief Simple math operations.
* */

/** @addtogroup Scalar
* @ingroup Math
* @brief Simple scalar operations.
/** @addtogroup LinAlg
* @{
*/
namespace la = linalg;
Expand All @@ -47,6 +45,13 @@ using ivec2 = la::vec<int, 2>;
using ivec3 = la::vec<int, 3>;
using ivec4 = la::vec<int, 4>;
using quat = la::vec<double, 4>;
/** @} */

/** @addtogroup Scalar
* @ingroup Math
* @brief Simple scalar operations.
* @{
*/

constexpr double kPi = 3.14159265358979323846264338327950288;
constexpr double kTwoPi = 6.28318530717958647692528676655900576;
Expand Down Expand Up @@ -596,8 +601,6 @@ struct ExecutionParams {
/// Suppresses printed errors regarding CW triangles. Has no effect if
/// processOverlaps is true.
bool suppressErrors = false;
/// Deterministic outputs. Will disable some parallel optimizations.
bool deterministic = false;
/// Perform optional but recommended triangle cleanups in SimplifyTopology()
bool cleanupTriangles = true;
};
Expand Down
Loading

0 comments on commit 8e3807e

Please sign in to comment.