Skip to content

How to create dimensioned drawings? #61

Closed

Description

@ToddG

WHAT
I'd like to create dimensioned drawings for shop work.

WHY
For me, solidypython and openscad are tools for generating shop drawings, not for sending to a 3D printer.

HOW
I see that OpenSCAD has a library for creating dimensioned lines:

How can I use this openscad library in SolidPython?

For instance, here's one of the examples:

cube.py

#! /usr/bin/env python

from solid2 import cube, sphere, difference, set_global_fn
from solid2 import import_scad
import_scad("dimlines.scad")

set_global_fn(72)


difference()(
    cube([100, 20, 30]),
    sphere(5)
).save_as_scad()

I have downloaded the dimlines.scad file to the same directory as the "cube.py" file above. How do I use the dimlines scad utilities to generate technical drawing lines etc?

Activity

  1. jeff-dh commented on Jul 14, 2024

    @jeff-dh
    Owner

    Something like this should be the solution (this is untested!):

    from solid2 impoprt scad_import
    
    dimlines = scad_import("dimlines.scad")
    
    dimlines.line(length=2,
                         width=dimlines.DIM_LINE_WIDTH,
                         height=dimlines.DIM_HEIGHT,
                         left_arrow=false, right_arrow=false).save_as_scad()

    This could also work:

    from solid2 import use
    
    use("dimlines.scad")
    
    line(length=2, width=DIM_LINE_WIDTH, height=DIM_HEIGHT, left_arrow=false, right_arrow=false).save_as_scad()
  2. jeff-dh commented on Jul 19, 2024

    @jeff-dh
    Owner

    I'll close this. if there are any further questions -> reopen or create a new ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions