Skip to main content
Topic: OpenScad and Eagle (Read 5853 times) previous topic - next topic

OpenScad and Eagle

Hi,
out of a discussion on the blog I was wondering if one could use Openscad [1] and Eagle in a similar way like the exitsting
Eagle3D and EagleUp projects.
Openscad is a 3D modelling program which uses a scripting language as a core rather then a GUI.
Unlike Povray (Eagle3D), which renderes an image,  openscad creates 3D models which can be freely zoomed and rotated (like Sketchup).
Using a scripting language makes it fesonable for a tool to generate automatic openscad-code from a PCB in eagle.
Openscad is already well known in the 3D printer community. Its generated STL files can be feed into the printing toolchain.
The idea would be to have a model of the PCB including the components, after that you could draw the required enclosure and make sure all fits together. Finally, you could print this enclousure on one of the 3D printers (commercial and DIY) avaiable.

One think to consider would be the fact that it make not much sens to create another project which requires yet another part-library.
Therefore, I would believe one of the aims of this project would be to be able to read in existing part libs from EagleUp and maybe Eagle3D and generate automatically openscad models for it. Openscad can import STL files and hence this format might be a good starting point as an universal exchangable format between several projects.

Are there people around which are well known to SketchUp? I would like to know how easy it is to import and export STL-files into Sketchup.

[1] www.openscad.org

Re: OpenScad and Eagle

Reply #1
I don't see why not..
you'd have to have part models made first, with origins and orientation the same as the footprint.
The eagle up script outputs a .eup file, which is actually a text file, and inside it has all the information about the board.
coordinates off all the holes, vias and parts...as well as a description of the board dimension.
It also outputs images of the two layers witch you could use as textures for the 3d model of the board.....
The creator of the EagleUp is a nice guy, and I am pretty sure he'd help you out if you contact him.

*I see that openscad has a stl import option, so it might be easier to build your model in sketchup and export it as a stl file, and then import it to openscad...stl exoprt is a plugin for sketchup,
there is also a possibility to export from sketchup to meshlap via a 3d export function, and then generate a stl file from meshlab

here is the STL export plugin
best regards FIlip.

Re: OpenScad and Eagle

Reply #2
it would be fairly easy to convert .eup to .scad but there are few serious problems
 - openscad can assign colors to faces but no bitmaps so it will be fairly ugly
 - openscad is actually fairly slow with large number of objects (slower then sketchup), and pcb's will have lot of objects
 - openscad can't export the face colors to any other program (the exported object will lose the color properties) so the rendered image will be super ugly (and openscad itself ain't really a champion in rendering)

I'd rather make a script to generate AOI model or a script to import eup for Blender then play with openscad. Openscad is irreplaceable tool in reprap/repstrap world but I don't see it here.. mostly 'cause STL is seriously limited format..

Re: OpenScad and Eagle

Reply #3
Ohh yes I give you all this points.
The idea would be if it is just a script which is needed to make a openscad model and if we can use the same libraries, one could use povray, blender sketchup for nice rendering.
Openscad would just need an accurate model of the PCB and of all the parts (esp. the larger onces), thus, you could start desigining a case or other mechanical units for the project and print them on a 3D printer. It would not need to look as nice as a povray rendering but it would need to be accurate to align holes and openings for plugs, switches, LEDs, etc. 

Ideally if a script can do the major work, after you designed your PCB and send it to the fab, import the data in openscad and draw a box around it. Send it to the 3D printer and a case is waiting for the PCBs on arrival ;)

Re: OpenScad and Eagle

Reply #4
it is not that simple
1. you need to write the script to generate openscad, it's not that hard but not as simple also
2. you need to create ALL objects (packages) as STL's too as openscad can only open and position STL's. This would take huge amount of time and it would not be very useful as STL's don't even have color faces
3. You can export STL directly from sketchup and it will be as precise as the one from openscad so there's no real benefit in using openscad to generate STL of you board and parts
4. When you create openscad scene where you import few hundred STL objects (and that will happen as every header, resistor.. will be a separate STL you need to import) openscad becomes incredibly slow so manipulation becomes very hard

To generate an openscad script from eup is not a "brain hard" task, but it is a lot of work someone can invest in doing something actually useful :), but if you decide you want to spend your time on it, create a project log and I'm sure a lot of ppl will step in to help if you get stuck somewhere :)

Re: OpenScad and Eagle

Reply #5
Hey Arhi,

no no ... I completely agree that it would not make sense to create a new stl-based part lib. The idea was if SketchUp can export to STL and openscad could import, one could simply use the exsiting (and growing) SketchUp part-lib.
The script would mainly get the board, and place STL-objects at the right position, all in a openscad file.
I heard about the fact that many objects might slow down openscad.
Hmm... openscad is still heavlily pushed forward by the devs, guess they might like to help out too.
Don't get me wrong, I do not want to replace the existing projects. I just thought a openscad import/export could have some advantages for certain tasks..

However, what I feel is that it would make much more sense if all the people would agree on one common format for a 3D parts lib and hence we could have a much more feature rich large lib of nearly all possible parts and the joined effort would be a large time saver.

Re: OpenScad and Eagle

Reply #6
problem is openscad knows only STL and STL is UGLY.

openscad can only import STL and can export STL of all "useful" formats

If you already have parts in sketchup (and that seems to be the "agreed common format", I might hate it but wth, it is what it is .. I'd prefer STEP or IGES ..) and you already have a script that position them properly and you can export STL of the finished model as single part .. what do you want to use openscad for that you already don't do here "by default" ?!

openscad is awesome product that I use daily, the openscad dev team used to be pretty active on the reprap-dev list, (the whole list is pretty silent in past few months so ...) and most of us from within reprap project use openscad for almost all modeling .. but even as I use openscad in average 15+ hours weekly I don't see a single benefit from producing openscad code for the pcb assembly ...

Anyhow, don't let me stop you, it's interesting project, if you have time, go for it :)

Re: OpenScad and Eagle

Reply #7
BTW most commercial EDA tools (I know for sure about Altium and heard about some other ) use STEP/IGES models for their 3d view. Altium even uses those models to show you if components fit properly in 3d space (for e.g. if capacitor is too tall to fit under the lcd) ... I haven't seen a single one that uses STL

Re: OpenScad and Eagle

Reply #8
Sketchup has the capability to export directly to Blender, also to export to the IGES, STEP formats, this is a pro feature, but once its online its free for all...:)
best regards FIlip.

Re: OpenScad and Eagle

Reply #9
O.K. thats a valid point,

if you have the entire model already in Sketchup and can export is as STL to import it in OpenScad it would not make much sense to work on two scripts to do the same work. Actually, I did not dive too much into the 3D formats and can't argue about the uglieness of STL compared to other formats. If you mean UGLY = missing features, well than its a valid point. Otherwise, I try to avoid to read a datafile plain-text normally and hence I am not so much concerend about its beautiness ;)

@Arhi I follow the openscad dev mailing list. Sometimes there are discussions for feature improvements. Do you know if there is anything planed about bitmap rendering, etc. I guess it's not high on the dev-list taking the engineering purpose of openscad into account to get (simple) 3-designs to a 3D printer instead of creating some 3D art... Also I guess its more the limitation of the underlying libraries then a openscad limitation.

Did you ever try to export a model from Sketchup and import it in openscad?
I might give it a try this evening.

BTW. Is there any pattern behind ahri and arakis given that you both come from the same place ;)
Guess if I figure out you have to kill me :P

Re: OpenScad and Eagle

Reply #10
[quote author="torwag"]If you mean UGLY = missing features, well than its a valid point.[/quote]
UGLY == no colors

[quote author="torwag"]
@Arhi I follow the openscad dev mailing list. Sometimes there are discussions for feature improvements. Do you know if there is anything planed about bitmap rendering, etc. I guess it's not high on the dev-list taking the engineering purpose of openscad into account to get (simple) 3-designs to a 3D printer instead of creating some 3D art... Also I guess its more the limitation of the underlying libraries then a openscad limitation.
[/quote]

no, not that I know. openscad is fairly simple project where they use the open source library to manipulate primitives. your code is interpreted and primitives are created. Then the same open source library is used to compile the output. Rendering is not very important part of all that ...

Anyhow, in order to improve rendering capabilities first openscad need to start supporting different file types that would accept colors/bitmpaps ... and again that's not a big priority as it's mostly used for 3d printing community and we don't care too much 'bout  colors :D. Maybe now when 2 head machines gain some popularity ppl get interested in printing more then just object with one and support with other head that some need will arise but .. let's see ..

elco community is in no way too important to openscad devs :)

[quote author="torwag"]
Did you ever try to export a model from Sketchup and import it in openscad?
[/quote]

sketchup requires windoze, not my ball of soup ... so I have no clue how that actually works, I just know it does as lot of reprappers design in sketchup and export stl's for printing

[quote author="torwag"]
BTW. Is there any pattern behind ahri and arakis given that you both come from the same place ;)
Guess if I figure out you have to kill me :P[/quote]

hm pattern .. we are both from Belgrade (few hours of public transportation apart but same city, few other users from Belgrade are on forum too, also few others from the exYU also), we know each other (I regularly get Arakis to come to my workshop so that I can torture him), but not too much similarities other then love for electronics and place where we live, he is student of electronics working for DP, and I left university almost 20 years ago and work for some database consulting..

ah yes, and he uses winblows and sketchup every day :D