threadlib icon indicating copy to clipboard operation
threadlib copied to clipboard

Collision Test

Open adrianschlatter opened this issue 5 years ago • 3 comments

Find a way to test for collisions between nut and corresponding bolt.

Idea

Render a nut and bolt combination (example: tests/test.scad). Use “number of volumes” that OpenSCAD shows after rendering:

  • 3 volumes: PASS (1 volume nut, 1 volume bolt, 1 volume surroundings)
  • 2 volumes: FAIL (collision)
  • 1 volume: FAIL (something went terribly wrong)
  • More than 3 volumes: FAIL (probably thread did not overlap bolt / nut and remained a separate part)

Problem

Find a way to make OpenSCAD tell us the number of volumes in a programmatic way (we don’t want to open OpenSCAD and hit F6 for hundreds of threads).

adrianschlatter avatar Apr 21 '19 09:04 adrianschlatter

You could use the openscad command line application (e.g. openscad -o output.stl myfile.scad), which outputs messages to stderr, and grep for the result.

nh2 avatar Jan 24 '20 04:01 nh2

Unfortunately, it does not print the number of volumes. See discussion here.

adrianschlatter avatar Jan 24 '20 06:01 adrianschlatter

Since the forum has been closed and archived, here's the thread @adrianschlatter refers to: https://lists.openscad.org/empathy/thread/W3KYKIXDZDD2VQJUIZEKGBE6L3UTR5ZB

steve8x8 avatar Jan 04 '24 18:01 steve8x8