Skip to content

Commit

Permalink
Experiment with tolerance settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
starseeker committed Feb 19, 2025
1 parent 5f172f1 commit 97d4a37
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/librt/primitives/bot/plate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ edge_cyl(point_t **verts, int **faces, int *vert_cnt, int *face_cnt, point_t p1,
int
rt_bot_plate_to_vol(struct rt_bot_internal **obot, struct rt_bot_internal *bot, int round_outer_edges, int quiet_mode)
{
double mtol = std::numeric_limits<float>::min();
if (!obot || !bot)
return 1;

Expand All @@ -224,6 +225,7 @@ rt_bot_plate_to_vol(struct rt_bot_internal **obot, struct rt_bot_internal *bot,
// OK, we have volume. Now we need to build up the manifold definition
// using unioned CSG elements
manifold::Manifold c;
c.SetTolerance(mtol);

// Collect the active vertices and edges
std::set<int> verts;
Expand Down Expand Up @@ -329,6 +331,7 @@ rt_bot_plate_to_vol(struct rt_bot_internal **obot, struct rt_bot_internal *bot,
continue;

manifold::MeshGL64 rcc_m;
rcc_m.tolerance = mtol;
for (int j = 0; j < vert_cnt; j++) {
rcc_m.vertProperties.insert(rcc_m.vertProperties.end(), vertices[j][X]);
rcc_m.vertProperties.insert(rcc_m.vertProperties.end(), vertices[j][Y]);
Expand Down Expand Up @@ -449,7 +452,9 @@ rt_bot_plate_to_vol(struct rt_bot_internal **obot, struct rt_bot_internal *bot,
if (!quiet_mode)
bu_log("Processing %zd faces... done.\n" , bot->num_faces);

manifold::MeshGL64 rmesh = c.GetMeshGL64();
manifold::MeshGL64 rmesh;
rmesh.tolerance = mtol;
rmesh = c.GetMeshGL64();
struct rt_bot_internal *rbot;
BU_GET(rbot, struct rt_bot_internal);
rbot->magic = RT_BOT_INTERNAL_MAGIC;
Expand Down

0 comments on commit 97d4a37

Please sign in to comment.