adrianschlatter/threadlib

With my own thread table definition, the mesh is not closed.

tomboland opened this issue · 1 comments

Hi there,

I'm unable to get the simplest example working with my own thread definition. I have tried to create both M26x0.75 and M28x0.6 threads, but just include the M26 one in my example here here.

use <threadlib/threadlib.scad>

MY_THREAD_TABLE = [
    ["M26x0.75-ext", [0.75, 12.7, 25.4, [[0, -0.375], [0, 0.375], [0.7, 0.1], [0.7, -0.1]]]],
    ["M26x0.75-int", [0.75, -13.0, 26.0, [[0, 0.4], [0, -0.4], [0.65, -0.15], [0.65, 0.15]]]]
];

bolt("M26x0.75", turns=4, table=MY_THREAD_TABLE);

This example looks great in preview, but when I render it, I get the error ERROR: The given mesh is not closed! Unable to convert to CGAL_Nef_Polyhedron.

Full output here:

Parsing design (AST generation)...
Compiling design (CSG Tree generation)...
Rendering Polygon Mesh using CGAL...
ERROR: The given mesh is not closed! Unable to convert to CGAL_Nef_Polyhedron. 
CGAL Cache insert: union(){polyhedron(points=[[12.7,-2.8199 (323152 bytes)
CGAL Cache hit: union(){polyhedron(points=[[12.7,-2.8199 (323152 bytes)
Geometries in cache: 3
Geometry cache size in bytes: 311688
CGAL Polyhedrons in cache: 1
CGAL cache size in bytes: 323152
Total rendering time: 0:00:00.514
   Top level object is a 3D object:
   Simple:        yes
   Vertices:      240
   Halfedges:     720
   Edges:         360
   Halffacets:    244
   Facets:        122
   Volumes:         2
Rendering finished.

This is what I see in preview:

1709396126_1615_02m2024_3839Mar

And after rendering:

1709396194_1616_02m2024_3841Mar

The values I've come up for the thread table are sort of invented. I'm not sure how to go about getting proper values, but I figured they should be vaguely realistic?

I'd be very grateful for any assistance!

The M26 thread in question is for my AMScope microscope's camera adapter, and the M28 one is for a focal reducer that will go between my camera and the microscope.. I'm using OpenSCAD 2021.01, with CGAL r106731.d68ef56d8d8-1 compiled from git and threadlib r87.3830919-1 also from git (both packaged from the Arch User Repository, AUR, on Manjaro Linux)

I cannot immediately see what the problem is but maybe you could check the docs: Design of threadlib.