Design replication post STL generation.

Discussion in 'General Discussion' started by RobSmart, Jul 25, 2015.

  1. RobSmart
    RobSmart Member
    I have a design that I want to replicate many times in the same file for submission for printing.

    I am using OpenSCAD, where replication is easy. The problem is that replication prior to STL generation results in very long time to generate the STL. STL generation for a single instance of the design is a few minutes. A trial limited replication was well over an hour, and that was for a design well short of the 64MB limit on submitted designs.

    I have looked at the STL text file format (as output by OpenSCAD). It would not be too difficult to write some code to read the STL output from OpenSCAD, duplicate each vertex applying an offset and output the new file. That file can then go through something like MeshLab for reduction.

    Before I spend the time writing such a tool, I wondered if tools already exist to do this?

    All suggestions welcome.
     
    Last edited: Jul 25, 2015
  2. mkroeker
    mkroeker Well-Known Member
    You could try copying the single shell in a text editor as many times as needed, and then using netfabb studio basic to move the copies apart.
     
  3. RobSmart
    RobSmart Member
    Thank you for your suggestion. I am using OS X so used cat file1, file1 > file2. Netfabb basic detects the two shells in file2 and allows each to be moved. It also has duplication - didn't see that before! This allows duplication a number of times in each of z, y and z. This seems perfect.

    But, in both cases only one of the shells is saved. I assume that merge is required first, but that is only in the Pro version. For now I will write a program, unless my use of Netfabb proves to be wrong.
     
  4. mkroeker
    mkroeker Well-Known Member
    Ah, sorry, I forgot about that. Guess you would have to move the single shell around, export in each position and then concatenate the files. Writing your own code is the best solution then. I believe the stl reader part needed is contained in the public domain stl-to-3mf converter recently posted by shawn_halayka here
    (Can't really blame the FIT/netfabb people for restricting some useful features to the paid version, but there appears to be some gap in their pricing scheme for amateurs who can only expect to sell the odd piece every now and then)
     
  5. RobSmart
    RobSmart Member
    "Ah, sorry, I forgot about that."
    These things are easily over looked. No problem!

    On a related subject, the stated file limit is 64MB. What does this really mean?

    For example, for printing, I guess, only the co-ordinates of each vertex are required. But the same design will have different file sizes for binary v ascii, for inclusion or exclusion of normals and colour information, and I've noticed that .wrl files are smaller than .stl. Tools like Meshlab allow controls on what to export and the format. I wonder then what the optimal settings are for a maximum submittable design.


     
    Last edited: Jul 26, 2015
  6. mkroeker
    mkroeker Well-Known Member
    As far as I know, the 64mb is an upload limit only - you could zip-compress a larger ascii file if necessary, though binary stl without normals would probably be the most efficient. WRL can be smaller as it supports higher level primitives like sphere, cylinder and polyhedra, and uses indexing instead of redundant vertex coordinates for meshes. If you are close to the 64mb limit, chances are that you are close to the vertex limit (officially 1 million, inofficially I have seen claims that it has been raised to 1.5 or even 2 million vertices some time ago) as well...
     
  7. RobSmart
    RobSmart Member
    Once I have some software to quickly replicate my parts I can upload files until I get file size rejection. So a trial-and-error approach.

    Thanks once again for your guidance - very useful indeed.
     
  8. stonysmith
    stonysmith Well-Known Member Moderator
    You can also generate the single STL with Openscad and then use import() to bring in the completed STL back in and replicate it.

    here's an example:
    ===first scad file===
    cube([1,1,1]);

    ===second scad file===
    for (i=[0:3])translate([i*2,0,0])import("box.stl");

    I have used this method with mixed success.. sometimes Openscad can't read it's own output file, and sometimes your geometry is too complex for the amount of resources that Openscad consumes. But, I've often been successful with it.

    As mentioned above, it might be best to generate the single STL, use Netfabb to convert it to Binary and clean it up a little, and then use Openscad to replicate it.
     
  9. mkroeker
    mkroeker Well-Known Member
    Would import keep the stl as such, so that exporting the combined model would skip the (sometimes extremely) time-consuming CGAL rendering step ?
    I have often resorted to using the free but closed-source meshconv program to get from wrl to stl when shapeways' wrl import failed due to triangle limit (usually due to too many spheres, meshconv lets one define sphere complexity), as openscad literally took many hours to export the same model.
     
  10. wozwasntere
    wozwasntere Well-Known Member
    Some slicer software allows you to arrange several STL's on a virtual print bed then save them all as a single STL.

    Before I got a faster PC I used Makerbot Desktop to stack a dozen wheels together and even added a STL spruce (created in Openscad) then saved it all as one STL

    http://shpws.me/EI7S
     
  11. JACANT
    JACANT Well-Known Member