Part library as a design aid

discussion of design changes / improvements / suggestions

Are you interested in a library of parts? Which one? Would you contribute?

I am not interested.
0
No votes
I would use a SketchUp library.
7
35%
I would use an OpenSCAD/SolidPython library.
1
5%
I would contribute to the SketchUp library.
4
20%
I would contribute to the OpenSCAD/SolidPython library.
3
15%
I want raw OpenSCAD, not SolidPython.
1
5%
SolidPython is not the best choice: I'd use ______ instead.
0
No votes
Such libraries already exist, but there's no reason not to have our own.
4
20%
Such libraries already exist. Stop reinventing the wheel!
0
No votes
 
Total votes: 20

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Part library as a design aid

Post by cvoinescu » Thu Jul 25, 2013 9:21 pm

This is not a design idea as such, but rather meta.

I have, over time, accumulated SketchUp files with models for a variety of off-the-shelf parts (screws, washers, bearings, T-slot extrusion), MakerSlide parts (rail, carriage, V-wheels, eccentric spacers), and Shapeoko and eShapeOko custom parts. I still use an old version of SketchUp (from just before the license change, I think). I would like to group all my parts in a few files and publish them, so that others can use them too.

I also plan to model the eShapeOko in OpenSCAD, using SolidPython. To do so, I will have to re-create all the parts in OpenSCAD/SolidPython. Is there interest in such a library of parts?

Even if you don't use SolidPython, but use OpenSCAD, you can probably export all the parts as OpenSCAD code, but the SolidPython library would be easier to use.

Please select as many options as applicable.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

WillAdams
Posts: 8603
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

Re: Parts library as a design aid

Post by WillAdams » Fri Jul 26, 2013 12:40 am

I'm interested, but also confused --- what is solidpython and how did I miss it and why isn't it wikified??

I found: https://github.com/SolidCode/SolidPython

is it related to https://github.com/bjbsquared/SolidPy/b ... /readme.md ?
Shapeoko 3XL #0006 w/ Carbide Compact Router w/0.125″ and ¼″ Carbide 3D precision collets

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: Parts library as a design aid

Post by cvoinescu » Fri Jul 26, 2013 1:48 am

SolidPython is one of several OpenSCAD code generators that try to make OpenSCAD more friendly. I chose it because it seemed the easiest to extend with a few features I'd like to have. It is related to SolidPy in as much as it does about the same thing, but I don't think there's any connection between the projects. A few others exist, but they take different approaches (for instance, one is a fork of OpenSCAD that replaces the OpenSCAD language with Python). I think the OpenSCAD language is here to stay, with all its shortcomings, so I'd rather use a code generator.

I have finally understood that it would be hard for OpenSCAD to preserve any object attributes in the rendered geometry. Its "preview" renderer supports colors, but the CGAL renderer (which is used for everything else, including STL export) does not keep any information associated with the geometry. It seems that this is a limitation of CGAL, not of OpenSCAD, or at least that's what I read on the Internet. That means that I have no way to augment an OpenSCAD scene with color or material information, unless I generate one STL per material and then combine them. And that's exactly what I want to do: I'm going to add a material tag of some sort to SolidPython, and modify the OpenSCAD code generation to filter objects by material (or to generate OpenSCAD code with conditionals, but that's harder and there's no point). One model file would generate a number of .scad files, each of which rendered into a .stl file, then I'd import all of them into Blender and have it render the scene.

There are some subtleties about how materials should interact with each other, but I think I can make it work. The usual question is, if you union or intersect two objects of different materials, what material should their intersection be? There is precedent in OpenSCAD of giving special treatment to the first object in an operation, so that's going to be my answer: the material of the first object. Another feature: virtual objects which don't render normally, but instead change the material of the objects they intersect -- much like painting with a stencil, but in volume. SolidPython already has such a special kind of object that follows special rules during boolean operations: holes. I'd just add another one: paint.

Incidentally, the same feature would be useful for 3-D printing with multiple materials: the slicers want one STL per material. There's no easy way to make those STLs with OpenSCAD (one can simulate the stencil method, but it becomes awkward for more complex objects).
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

veng1
Posts: 250
Joined: Fri Nov 30, 2012 12:09 pm

Re: Parts library as a design aid

Post by veng1 » Fri Jul 26, 2013 3:37 am

I voted for the OpenSCAD/Python approach although I normally work in Alibre.

I haven't bothered to learn OpenSCAD but did fool around with, I think, FreeCAD, which I think is similar. A point and shoot GUI like Alibre or Solidworks seems easier to use in my mind.

I guess I'm going to have to learn OpenSCAD to have a valid opinion.

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: Parts library as a design aid

Post by cvoinescu » Fri Jul 26, 2013 4:26 am

SketchUp and OpenSCAD are the things I know how to use. I am making libraries for my own use anyway, but if there is interest, I'll put more effort into making them nice, and share them.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

bjbsquared
Posts: 102
Joined: Mon Nov 26, 2012 10:48 am

Re: Parts library as a design aid

Post by bjbsquared » Fri Jul 26, 2013 12:19 pm

WillAdams wrote:I'm interested, but also cnfused --- what is solidpython and how did I miss it and why isn't it wikified??

I found: https://github.com/SolidCode/SolidPython

is it related to https://github.com/bjbsquared/SolidPy/b ... /readme.md ?
It is only related in the sense that it was inspired by it. I had a hard time following the code as I was a beginning programmer in python. The code I wrote was a from scratch effort. It was some sort of thing that I had to get out of me at the time. I was thinking the other day it could be extended to generate G-Code. I'm not sure if I have the skills to do it. Straight lines and circular holes might not be to bad but SVG, DXF path offsetting is a bit over my head.
#1016 - 1M x 1M Y: Dual Motor Drive w/Looped Belts, X:Dual Rail with wlanfox blocks, Z: Stock, Spindle:DW660

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: Part library as a design aid

Post by cvoinescu » Fri Jul 26, 2013 1:23 pm

I've done G-code generation with path offset (tool radius compensation), with optional automatic dogbones or bisect lines for inside corners, in Python. The mathematics are sound, but it isn't a nicely encapsulated library yet. I haven't handled DXF files programatically either -- my program requires a Python definition of the shape, and it supports polygons with sharp and rounded corners (each corner can have its own radius), but not arbitrary arcs. I would not try to merge that project with an OpenSCAD front end, except that it would be neat if the same code could also generate OpenSCAD code or even DXF files. Also, the "polygon with rounded corners" case is very common in my designs, so I think it should have direct support in SolidPython (shouldn't be too difficult).
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

Will Winder
Posts: 435
Joined: Fri Apr 20, 2012 2:40 pm
Location: Hudson, MA
Contact:

Re: Part library as a design aid

Post by Will Winder » Fri Jul 26, 2013 4:39 pm

I'm not 100% clear about what you're trying to build here, but there is an OpenSCAD library called MCAD which sounds similar to what you're describing. If it is close enough, you might be able to add features to it instead of making a new library.
ShapeOko #367: Dual-Y drive, Belt on outside, 1000mm Y-Axis, DW660 Spindle, Nema-23 X/Y motors.

Primary developer on Universal Gcode Sender.

bjbsquared
Posts: 102
Joined: Mon Nov 26, 2012 10:48 am

Re: Part library as a design aid

Post by bjbsquared » Fri Jul 26, 2013 5:03 pm

I think things could be setup with subtractive manufacturing in mind. Something that supports 2.5D Could have a variable for stock material and then subtractive features that would generate G-Code. The resulting Open SCAD model would be for visual verification. Perhaps the tool path could also be generated as a separate object/OpenSCAD file. One program to generate a model, G-Code and Tool path would be great.
#1016 - 1M x 1M Y: Dual Motor Drive w/Looped Belts, X:Dual Rail with wlanfox blocks, Z: Stock, Spindle:DW660

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: Part library as a design aid

Post by cvoinescu » Fri Jul 26, 2013 6:05 pm

Will, thank you, that is very interesting. I was planning something much simpler than that. I'll look at MCAD carefully.

Bjbsquared, that's exactly what I had in mind. A very simple way of describing 2.5D objects in Python, whose main purpose would be to generate G-code; additionally, it could also generate OpenSCAD files, for visualization and for inclusion in models and mock-ups. A sort of programmer's CAM, much like SolidPython/SolidPy/OpenSCAD are a programmer's CAD.

I did not think of generating the toolpath, only because G-code is, pretty much, [a representation of] the toolpath, and there are viewers for it (OpenSCAM). I'm not very ambitious: I don't want a renderer with toolpath visualization, not yet, although that would be very nice. I'm content with simple program that outputs text that's read by OpenSCAD, OpenSCAM, and the CNC mill.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

Post Reply