3d3d-modellingopenscadopenjscad

Is that possible to draw a line using Openscad by joining different points?


I'm trying regularly to join the different points to draw the straight line in OpenScad. But I could'nt able to find any way to draw the line. But I can able to draw the definite shapes like cubes,spheres,cylinders,etc... So please help me by directing to get into the correct program coding to draw the straight lines by joining the different points.


Solution

  • OpenSCAD currently doesn't have a line primitive; all primitives have to be closed volumes or closed polygons. You can simulate a "line" in space by using hull(), and even package that as a module:

    module line(start, end, thickness = 1) {
        hull() {
            translate(start) sphere(thickness);
            translate(end) sphere(thickness);
        }
    }
    
    line([0,0,0], [5,23,42]);