Skip to content

Commit 4006c00

Browse files
INIT meshing and booleans.
1 parent a507e1f commit 4006c00

File tree

73 files changed

+82
-3158
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+82
-3158
lines changed

CMakeLists.txt

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -198,46 +198,62 @@ find_package(nanobind CONFIG REQUIRED)
198198
#
199199
# Important: If you add a new .cpp file, you must rebuild the project with:
200200
# pip install --no-build-isolation -ve . -Ceditable.rebuild=true
201-
file(GLOB CPP_SOURCES
202-
CONFIGURE_DEPENDS
203-
"${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp"
204-
)
205201

206-
# Verify we found all expected source files and remind about type handling
207-
message(STATUS "Found C++ source files (ensure proper type conversion in each):")
202+
# Add the booleans module
203+
nanobind_add_module(
204+
booleans_ext
205+
STABLE_ABI
206+
NB_STATIC
207+
src/booleans.cpp)
208208

209-
foreach(source ${CPP_SOURCES})
210-
message(STATUS " ${source}")
211-
endforeach()
209+
# Set include directories for the extension
210+
target_include_directories(booleans_ext PRIVATE
211+
${CGAL_INCLUDE_DIR}
212+
${BOOST_INCLUDE_DIR}
213+
${EIGEN_INCLUDE_DIR}
214+
)
215+
216+
message(STATUS "Checking for src/meshing.cpp")
217+
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/meshing.cpp")
218+
message(STATUS "src/meshing.cpp found")
219+
else()
220+
message(FATAL_ERROR "src/meshing.cpp NOT found")
221+
endif()
212222

223+
# Add the meshing module
213224
nanobind_add_module(
214-
compas_cgal_ext
225+
meshing_ext
215226
STABLE_ABI
216227
NB_STATIC
217-
${CPP_SOURCES}
218-
)
228+
src/meshing.cpp)
219229

220230
# Set include directories for the extension
221-
target_include_directories(compas_cgal_ext PRIVATE
231+
target_include_directories(meshing_ext PRIVATE
222232
${CGAL_INCLUDE_DIR}
223233
${BOOST_INCLUDE_DIR}
224234
${EIGEN_INCLUDE_DIR}
225235
)
226236

227237
# Make sure external dependencies are downloaded before building the extension
228-
add_dependencies(compas_cgal_ext external_downloads)
238+
add_dependencies(booleans_ext external_downloads)
239+
add_dependencies(meshing_ext external_downloads)
229240

230241
if (ENABLE_PRECOMPILED_HEADERS)
231242
# Enhanced PCH configuration
232243
set(CMAKE_PCH_INSTANTIATE_TEMPLATES ON)
233244
set(CMAKE_PCH_WARN_INVALID ON)
234245

235246
# Configure PCH for the extension
236-
target_precompile_headers(compas_cgal_ext
247+
target_precompile_headers(booleans_ext
248+
PRIVATE
249+
src/compas.h
250+
)
251+
target_precompile_headers(meshing_ext
237252
PRIVATE
238253
src/compas.h
239254
)
240255
endif()
241256

242257
# Install directive for scikit-build-core
243-
install(TARGETS compas_cgal_ext LIBRARY DESTINATION compas_cgal)
258+
install(TARGETS booleans_ext LIBRARY DESTINATION compas_cgal)
259+
install(TARGETS meshing_ext LIBRARY DESTINATION compas_cgal)

docs/api.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,5 @@ API Reference
66
:maxdepth: 1
77

88
api/compas_cgal.booleans
9-
api/compas_cgal.intersections
10-
api/compas_cgal.measure
119
api/compas_cgal.meshing
12-
api/compas_cgal.slicer
13-
api/compas_cgal.skeletonization
14-
api/compas_cgal.subdivision
15-
api/compas_cgal.triangulation
16-
api/compas_cgal.types
1710

docs/api/compas_cgal.intersections.rst

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/api/compas_cgal.measure.rst

Lines changed: 0 additions & 13 deletions
This file was deleted.

docs/api/compas_cgal.skeletonization.rst

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/api/compas_cgal.slicer.rst

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/api/compas_cgal.subdivision.rst

Lines changed: 0 additions & 14 deletions
This file was deleted.

docs/api/compas_cgal.triangulation.rst

Lines changed: 0 additions & 15 deletions
This file was deleted.

docs/api/compas_cgal.types.rst

Lines changed: 0 additions & 18 deletions
This file was deleted.

docs/examples/example_booleans.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from compas_cgal.booleans import boolean_intersection_mesh_mesh
1111
from compas_cgal.booleans import boolean_union_mesh_mesh
1212
from compas_cgal.booleans import split_mesh_mesh
13-
from compas_cgal.meshing import mesh_remesh
13+
# from compas_cgal.meshing import mesh_remesh
1414

1515

1616
def input():
@@ -19,7 +19,6 @@ def input():
1919
A = box.to_vertices_and_faces(triangulated=True)
2020
sphere = Sphere(1, point=[1, 1, 1])
2121
B = sphere.to_vertices_and_faces(u=64, v=64, triangulated=True)
22-
B = mesh_remesh(B, 0.3, 50)
2322
return A, B
2423

2524

0 commit comments

Comments
 (0)