OpenSCAD Modules

Glenn Butcher Mar 27, 2022

  1. Glenn Butcher

    Glenn Butcher TrainBoard Member

    177
    338
    9
    Been thinking about doing this for a while, a thread over at MRH finally pushed me over the edge...

    At MRH, a thread about 3d printing brick patterns. Repetitive patterns are tedious to do by hand; this is where the script-based CAD softwares shine IMHO. So, I wrote a brick pattern, posted it to the thread over there, and their forum software mangled it even when using their code formatting tool (I don't see one here...)

    So, I started a GitHub repo to deposit such as I make them:

    https://github.com/butcherg/modelingtools

    It'll all be public domain, use as you see fit. It'll also all be OpenSCAD, but one can render the pattern they need in OpenSCAD, export it to .STL and most CAD programs should be able to import that. I tested FreeCAD 0.18, it read a brick pattern just fine.
     
    JMaurer1 and SLSF Freak like this.
  2. Sumner

    Sumner TrainBoard Member

    2,831
    5,950
    63
    Have you considered trying Fusion 360. It is free if you don't plan on making money off of it.

    Doing any type of pattern over a larger area, along a path, in a circular or rectangular pattern is pretty easy using the 'Pattern' tool. Highly recommend it and have been using it on all of my designs ( HERE ). Being able to use a CAD program that costs $500 a year if you aren't a hobbyist is a good deal.

    Sumner
     
  3. Glenn Butcher

    Glenn Butcher TrainBoard Member

    177
    338
    9
    I've considered Fusion360, but not 'till after I'd started with OpenSCAD. My first profession is programmer, so doing thing this way just feels right. I also like the idea of developing modules and using them in different places. I've tried a few interactive open-source programs, but I felt like I was spending too much time learning them. I'll be honest, though; even though I don't plan to do any of this commercially, I don't like someone having restrictions on how I use my IP...
     
  4. martink

    martink TrainBoard Member

    64
    241
    9
    It is good to see someone else using OpenSCAD for model trains. I use it for literally everything from mechanisms like turntables to buildings, bridges and even the trains themselves. It is a very powerful, natural and intuitive tool for anyone with a strong software background. For normal human beings, not so much. :)

    Its biggest strength is being able to parameterize a design. For example, my T Gauge UK goods stock is built with two 4-wheel wagon bodies on a shared long chassis, so I can build any combination of vehicles and loads I want with one call: twoWagons( type1, load1, type2, load2 ). A dozen calls of that module and I can build an entire train of 24 wagons in one STL file. Its biggest weakness is extremely slow rendering of large areas made up of small objects, such as brick walls, random stonework, paving, etc.
     
    Glenn Butcher likes this.
  5. Glenn Butcher

    Glenn Butcher TrainBoard Member

    177
    338
    9
    I ran across recent work to speed it up; you can read about it here: https://github.com/openscad/openscad/pull/3641. I don't think it's in a release yet.

    Yeah, I save rendering for .STL for my desktop computer for some items, like my boiler/smokebox with all the rivet work. I may end up splitting the courses for separate files for printing so I don't get a print failure 95% of the way through the whole thing...

    Disclaimer: I haven't printed anything yet. Just bought a Mars 3, I'm building an enclosure for it to control temperature and capture resin fumes. Maybe this week...
     
  6. BoxcabE50

    BoxcabE50 HOn30 & N Scales Staff Member TrainBoard Supporter

    67,638
    23,016
    653
    There is a BB Code Editor, if that is what you were seeking?
     
  7. Glenn Butcher

    Glenn Butcher TrainBoard Member

    177
    338
    9
    Yep! Thanks!
     
  8. Glenn Butcher

    Glenn Butcher TrainBoard Member

    177
    338
    9
    I pushed the last commit for brickpattern.scad last night. It now lets one switch the half-brick rows, and will randomly rotate individual bricks slightly to model less-than-skilled masonry. That'll be it for that module, but I always take fixes and consider enhancements.

    Thinking a clapboard siding module might be useful, as I'm probably going to model some lineside structures in the near future, but I need to get the printer going first.
     

Share This Page