r/openscad

Free browser tool that turns STL meshes back into editable CAD solids (STEP)
▲ 484 r/openscad+1 crossposts

Free browser tool that turns STL meshes back into editable CAD solids (STEP)

We've all been there: a model is almost right. Import it into CAD and you get thousands of triangles you can't really edit.

So I built Mesh2Solid. It analyses the mesh and rebuilds the actual geometry: planes, cylinders, cones, tori, spheres, even threads. The result is a STEP file where a bore is a real cylinder. Change its diameter in Fusion 360, FreeCAD or SolidWorks, then slice it as usual; PrusaSlicer, OrcaSlicer and Bambu Studio import STEP directly.

How it works

  1. Open an STL, 3MF or OBJ file
  2. Click "Analyse mesh"
  3. Download the STEP file and edit it in your CAD

Good to know

- Runs entirely in your browser, files are never uploaded

- Works best on meshes that came out of CAD (most functional prints). Scans and sculpts end up mostly as freeform surfaces.

- Bigger models take a few seconds: a 113,000-triangle model took about 7 s on my M5 Pro

👉 https://mesh2solid.thavision.com

Full disclosure: It's free for hobby use and will fit 99% of the average user‘s needs; a Pro licence (€12/year) adds manual face repair, some quality of life as well as forensic features, and is needed for commercial use.

Feedback is very welcome, especially meshes where the recognition fails, so I can improve it.

u/Amaral9130 — 9 days ago

I've used OpenSCAD for years and kept hitting the same walls, so I built exact CAD modelling for GNU Octave

OpenSCAD has served me well, and I still think its idea is right: a part should be a program, not a pile of mouse clicks. But a few of its limits kept biting me:

- **Everything is facets.** A cylinder is $fn sides, so its edges can't be rounded after a boolean, and the part reaches a CAD program as triangles, never as a true cylinder.

- **No fillets or chamfers on the edges you actually have.** Rounding the result of a difference means minkowski or a library trick, and it gets slow.

- **You can't ask a shape anything.** Not its volume, not its size, not where its edges are, so a script can't adapt to its own geometry.

- **No STEP**, so a part can't go to a machinist's CAM or a colleague's CAD with its geometry intact.

- **The language is small.** No real data structures, no numerics, no plotting, so computing anything, a gear profile, a cam, a stress estimate, happens somewhere else.

I'm a GNU Octave developer, so I built the thing I wanted as an Octave package, **drafting**, on top of Open CASCADE, the kernel FreeCAD and CadQuery use. Version 0.2.0 is out today.

Here is the classic CSG example, the cube and sphere with three bores, rebuilt:

body = intersect (solid.box (15, 15, 15, 'Anchor', 'centroid'), solid.sphere (10));
c = solid.cylinder (5, 20, 'Anchor', 'centroid');
S = subtract (body, c, rotate (c, 90, [1, 0, 0]), rotate (c, 90, [0, 1, 0]));
F = fillet (S, edges (S, 'Type', 'circle'), 0.8);
write (F, 'csg.step');
write (F, 'csg.stl');

The fillet line is the one OpenSCAD can't do: the bores' rims are exact circles, so edges finds them by type and `fillet` rounds them. The result goes out as STEP with its curved faces kept, and as STL for the slicer.

OpenSCAD's classic CSG model, rebuilt with exact geometry and every circular edge rounded in one line.

What you keep from OpenSCAD: the part is a script, the booleans read the same union, subtract, intersect, and hull, resize, mirror, text and linear and rotational extrusion with twist and scale are all there. A tutorial for OpenSCAD users maps OpenSCAD's words to the package's, one by one.

What you gain: shapes are values in variables, so a function returns a part and a loop builds an array of them; holes with counterbores and countersinks; shells; lofts and sweeps along 3-D paths; sections that are exact outlines you can extrude again; volume, area and bounding box; assemblies saved to STEP and 3MF with names and colours; and technical drawings to DXF and paper, with dimensions. And it's all inside Octave, so the maths that shapes the part sits in the same script.

Honest limits: it builds on Linux only for now, from source, against Open CASCADE's development packages (one `apt` line on Debian or Ubuntu). There's no editor with a live preview; you call `show` and the viewer window redraws. Windows and macOS are on the roadmap.

- Guide with twelve tutorials: https://pr0m1th3as.github.io/drafting/guide/

- Repository: https://github.com/pr0m1th3as/drafting

I'd really like to hear from OpenSCAD users: which of your models would break first, and what you'd miss.

reddit.com
u/pr0m1th3as — 10 days ago

Handling library of in build features in OpenSCAD Model

I wanted to use OpenSCAD to make some 3D configurable models, bunch of library cut outs on a plate etc for 3D printing. How is best to “database” these in the file/store?

·       Looked at bunch of DXFs but they still need metadata and if I want an online configurator but seems easier way.

·       I understand I can import a JSON but there is still external dependency and they needs

·       A lot of people just seem to draw which matches as the way of selecting multiple options is limited in the configurator anyway.

At this point I was going to just hand draw each class which seems to be what others have done do but I thought I would ask around for the best methods out there. Its 2D shape and cuts for plates etc.

reddit.com
u/bobo5195 — 9 days ago

Intersection of two pipes (BOSL2)

I've modeled a pipe intersection like you can see in the image, but because of how I subtracted the extra parts of each pipe, there's an infinitely thin wall in the middle of the intersection. Any suggestions on how to get rid of that without making a visible cut in the inside of the intersection?

Here's my code:

include <BOSL2/std.scad>
$fa = 1;
$fs = 0.4;
outer_diameter = 100;
inner_diameter = 96.8;
lower_height = 34;
upper_height = 25;
pipe_angle = 15;

diff()
// lower tube
cyl(h=lower_height,d=outer_diameter,anchor=BOTTOM) {
    // inner negative
    tag("remove")
        position(CENTER)
        down(1)
        cyl(h=lower_height+2,d=inner_diameter);
    // remove parts that would intersect with the other tube
    tag("remove")
        position(FRONT+TOP)
        xrot(-pipe_angle/2)
        cyl(h=100,d=outer_diameter+10,anchor=FRONT+BOTTOM);
    // upper tube
    tag_diff("keep", "rem", "ke") position(FRONT+TOP)
        xrot(-pipe_angle)
        cyl(h=upper_height,d=outer_diameter,anchor=BOTTOM+FRONT) {
            // inner negative
            tag("rem")
                cyl(h=upper_height+2, d=inner_diameter);
            // remove parts that would intersect with the other tube
            tag("rem")
                position(FRONT+BOTTOM)
                xrot(pipe_angle/2)
                cyl(h=100,d=outer_diameter+10,anchor=FRONT+TOP);
        }
}
u/GooeyGungan — 9 days ago

How accurate is 3D scanning for reverse engineering aerospace parts? Checking before we build CAD.

We need to reverse engineer a small aluminum bracket from an older aircraft. It has a deep pocket and a few holes held to about 0.05 mm.

Our scan looks clean, but I don't trust it yet on those features.

Where is a scanner good enough, and where do you still use a CMM?

I read that scan data can drift from nominal until the datums are set right, but I'm not so sure. How do you check the scan before anyone starts modeling?

reddit.com
u/terrible-technicians — 11 days ago

OPENSCAD CLI - make your AI agent easier create 3d object based on rules

I'm maintaining this open source project, hopefully it helps every openscad lovers, still lack a lot of features, need our real openscad users test and contribute, it pre-baked some documentations as knowledge e.g. ikea skadis, gridfinity.
also going to add rules on how to make 3d object 3d print friendly, without support, or something.

github.com
u/atom2ueki — 11 days ago

CageMaker PRCG v0.7 :: Parametric Rack Cage/Faceplate/Enclosure Generator

It's that time again. Time for another version update for CageMaker PRCG.

This time it's a big one. We're talking about a near-total refactor with almost all of the source code rewritten and optimized, and the entire thing restructured to make it easier to add features and maintain. A ton of features were added but the entire thing only grew about thirty kilobytes (excluding comments).

The documentation got a rewrite as well. It's no longer wiki-based, but still has coverage of literally every single setting and what it does, complete with screenshots. A copy of it comes along for the ride when downloading/cloning the repository, or clicky linky to see it on Github right now.

 

What does this do? Create this, print this, rack-mount this.

 

And of course the important bit:

Github repo - Or, just do "git clone https://github.com/WebMaka/CageMakerPRCG.git" if you have git installed.

CageMaker PRCG runs best in OpenSCAD. Don't have OpenSCAD? Grab that here.

Or, try it in a web browser thanks to the WebAssembly port of OpenSCAD, OpenSCAD Playground.

 

The new additions to this version:

  • Almost completely refactored to break up massive routines into easier-to-modify and easier-to-maintain smaller segments and subroutines. This should make codebase finalization for 1.0 significantly easier, while also making for a more robust generator overall going forward.

  • Added the option to selectively disable any cage side. (Requested by Github user "Nepherim")

  • Added options to expand the faceplate upward or downward to cover openings or structures. The downward setting can emulate Homeracker "flush to bottom" for covering reinforcing bars. (Requested by Reddit/Github user "dekonnection")

  • Added the option to shift the mounting holes on either side of the faceplate up or down relative to the center of the topmost unit on the faceplate. This can be used to flip upside-down asymmetric cages that are half-unit height multiples, such as Keystone patch panels. (Requested by Reddit/Github user "dekonnection")

  • Improved the structure of rear support cages to handle heavier weight and greater extension range without sagging. Also changed the cage generation to make horizontal support ribs mandatory when a rear support cage is generated, so as to make a more effective overlapping joint between front and rear cages for greater rigidity.

  • Added faceplate modifications for 88x56mm SBCs such as Raspberry Pi, or any other SBC with this footprint along with M2 mounting holes in a 49mm x 58mm pattern. These modifications include a standalone support frame for the SBC, and include horizontal as well as vertical in both left-oriented and right- oriented.

  • Added faceplate modifications for standard motherboard rear-panel IO shield openings, Mini-ITX motherboards, and full-height and half-height PCI slots.

  • Added faceplate modifications for mounting ATX, SFX, and TFX power supplies.

  • Added the option to generate a cage without opening a corresponding hole in the faceplate for inserting a device. Useful for creating custom rackmount enclosures when combined with faceplate modifications.

  • Added the option to make the back of the cage solid, which can be useful for creating custom rackmount enclosures with solid backs for mounting connectors, etc., or remove most of the back aside from two 6mm wide retention lips on both short sides.

  • Added the capability to place left/centered/right modifications on the back of the cage when said back is set to solid. This makes creating custom rack enclosures significantly easier by generating cutouts directly into the cage back.

  • Added options to remove most of any side of the cage except for its support structure, or remove the side entirely.

  • Added custom rack widths for 12, 14, and 16 inch racks, as well as a 12.66 inch wide, 2/3-width rack for 19 inch racks.

  • Added direct support for EIA-310 racks using 2020 aluminum extrusion for framing. Since these racks have a reduced internal width, conventional cages often don't fit - selecting this rack geometry sets CageMaker to be more aware of the geometry differences for this rack design.

  • Added support for more non-EIA-standard rack geometries, including direct support for Homeracker and MR248 rack systems.

  • Added the ability to set custom rack geometry for non-standard racks. Unit height, hole spacing/centers/size, and mounting reservation space are all adjustable.

  • Modified the faceplate generator to more accurately locate screw holes on EIA-compliant racks.

  • Added the option to generate screw holes for mounting instead of 5mm wide slots. This will make for better aesthetics but may cause alignment issues on racks with slightly off-spec mounting hole centers.

  • Added the option to place screw-hole standoffs on the bottom of the cage when its geometry is set to solid. Screw hole size and standoff height are configurable.

  • Added the option for faceplate ventilation grids to only generate full holes.

  • Changed the resolution for most sizing and offset options to half-millimeter increments instead of full-millimeter only.

  • Improved the retention-lip generation code to make it more reliable.

  • Changed behavior under "error" conditions - CageMaker PRCG will no longer force-correct any problems it detects, such as re-centering faceplate modifications that exceed exclusion zones. This will permit forcing a render operation when the end result will work but might have clearance issues that CageMaker PRCG doesn't like but don't pose a problem in practical application.

  • Added an option to suppress "CHECK CONSOLE" error warning for rare situations where the generated cage throws an error that doesn't actually cause issues. This should be used VERY SPARINGLY, as it can result in an unprintable cage or one that has fitment issues.

  • Added a greeting that appears in the console when the script runs, which also displays the maximum width for a single device that can be placed in a single cage with the current settings.

  • Added a logotype graphic with version number and URLs that can be disabled via option in the "rarely changed options" category in the Customizer.

 

Not a bad list of new additions for an update, IMO, but I'm biased...

 

CageMaker PRCG Features

Create Widely-Compliant Rackmount Cages To Fit Any Rack System

  • Generates rack faceplates that are by default designed to comply with EIA-310 standard mounting hole patterns, which is used on the vast majority of modern rack systems. Triple-hole, slotted, 1/2"-5/8"-5/8" staggered spacing, 1.75"/44.45mm "unit" height, sized for #10/M5 mounting hardware.
  • Can optionally generate cages for rack systems that don't follow EIA-310, which can be useful for custom 3D printable mini- and micro-rack systems. Simply select the system's "unit" size and mounting hole spacing and CageMaker automatically adjusts accordingly.
  • Generates full width rack cages for 5", 6", 7", 10", and 19" racks.
  • Generates one-half-width, bolt-together cages for 10" and 19" racks. Mounting ears are automatically generated on one side of the cage for bolting two of them together and optionally, alignment pin holes can be added to allow the use of short lengths of filament as alignment pins.
  • Generates one-quarter-width, one-third-width, or two-thirds-width bolt-together cages for 19" racks. Again, mounting ears for bolting cages together are automatically added as required (and again, optionally, alignment pin holes can be added) - outer cages have a single ear on one side and inner cages have two, one on each side.
  • Automatically adjusts height to fit the device to mount in full "unit" multiples by default, and half-unit multiples as an option.
  • Full-unit cages are symmetrical by default as long as the cage proper is left to its default offsets. Half-unit cages are asymmetrical but two half-unit cages can be aligned by rotating one so its half-holes butt against its neighbor's half-holes. If it becomes necessary to "flip" a cage that has a half-unit-multiple height, a single option shifts the mounting holes to make this happen.
  • Partial-width cages can be mixed-and-matched for height - attach two 1U halves to a single 2U half. (NOTE: This requires that the "top and bottom holes only" option NOT be used.)
  • Enforces safe mounting by maintaining a minimum mounting clearance of 15.875mm or 5/8" on both sides of the faceplate (on EIA-compliant racks) and warns if any aspect of the cage design intrudes into that space.

Durable Rack-Mounting For Smaller But Heavier Equipment

  • Adjustable plus-profile corner-support structure for maximum rigidity with minimal material consumption.
  • Supports devices up to 5Kg or 11 lbs. per complete cage.
  • Defaults to 4mm thickness for all flat surfaces, but this can be increased to 5mm, 6mm, or 8mm for greater stiffness and better support for heavier gear.
  • Optionally add faceplate reinforcing to reduce twisting/cantilevering.
  • Optionally generate additional supports on the top and bottom of the cage.
  • Optionally generate the top, bottom, and/or sides as solid surfaces for additional rigidity.
  • Optionally generate a rear-mounted support sub-cage to support larger/heavier devices from both front and rear by attaching to both front and rear rack rails. The rear support cage interlocks into the back of the cage holding the device.

Loads Of Customizable Cage Options To Fit Any Device

  • The back, sides, top, and bottom of the cage proper are mostly open for ventilation by default as long as the device is at least 20mm deep on any given axis. Optionally make the "top" and/or "bottom" of the cage a solid shelf and/or make the sides of the cage solid.
  • Easily create side-by-side cages for multiple same-sized devices - enter the dimensions of one device and increase the number of devices as needed. Excellent for mounting a lot of smaller things such as tiny-form-factor SBCs or external hard drives in minimal space.
  • Multiple cages can be gapped out from each other for better air circulation, which can be helpful for hot-running devices.
  • Optionally add screw holes in tabs to the short edges of a cage opening, or the corners of the opening, or both, with selectable hardware sizes. Couples well with multiple-same-sized-device cages, and useful for subrack assemblies - excellent for stuffing several Raspberry Pis or other small SBCs into a rack.
  • By default, a cage is centered both horizontally and vertically on its faceplate. Positioning can be adjusted on both axes to move a cage to the top or bottom, to either side, or a combination of both.
  • Standoffs can be positioned on the bottom of a cage, and both height and screw diameter are configurable.
  • Add up to three sets of add-on faceplate modifications, one on either side of the cage proper and one in the center when creating a cageless faceplate, each of which can be any one of the following:
  • Keystone module receptacles
    
  • Neutrik D-Series connector cutouts
    
  • Cutouts and mounting bases with M2 screw bosses for mounting 85x58 SBCs such as Raspberry Pi. These can be mounted horizontally, or vertically with the SBC's "top"/"up" side facing left or right.
    
  • Cable management combs in two widths and two heights.
    
  • Motherboard rear-port IO shield cutouts.
    
  • Full-height or low-profile PCI slots for PC expansion cards.
    
  • Mini-ITX motherboard backplane with IO shield cutout and low-profile PCI slot.
    
  • ATX, SFX, and TFX power supplies.
    
  • 30mm, 40mm, 60mm, 80mm, 92mm, 120mm, or 140mm cooling fans
    
  • 10mm, 12mm, 16mm, 19mm, or 24mm holes for things like a pushbutton or panel-mount indicator light
    
  • Fractional-DIN cutouts in 1/32- to 1/4-DIN sizes
    
  • VESA FDMI MIS-B/-C/-D/-E/-F mounting patterns up to 200mm for attaching VESA mounting brackets to the rack or the rack to VESA mounting brackets
    
  • IEC-60309 industrial power inlet cutouts for 16A and 32A inlets
    
  • IEC AC Mains sockets and outlets - C13/C14 and C19/C20 - in both screw-mount and snap-in formats.
    
*    Up to three custom cutouts of configurable diameter for round holes or height and width with optional corner rounding for rectangular.
  • Faceplate modifications can be placed into a grid of up to 12 columns by 4 rows, space permitting.
  • Faceplate modifications can be automatically centered between the device(s) and the edge of safe mounting area, or manually moved. Centered modifications are automatically centered vertically, and side modifications can be shifted from centerlines.
  • Can generate a faceplate without a cage proper, with selected modifications, or as a blank.
  • Can generate a cage with a solid faceplate, which can also have modifications mentioned above, instead of being open for front-loading a device.
  • Optionally add a 1mm retention "lip" on the front of the cage to help retain the device, which is recessed into the cage by 1mm to compensate.
  • Selectable hardware for bolt-together and split cages - both metric (M3 through M6) and US-standard/imperial (4-40 through 1/4-20) hardware are supported, including both clearance and threaded hole diameters as well as common heat-set insert sizes by their thread pitch and mounting hole diameters.
  • Add ventilation to the faceplate of any cage. The pattern, horizontal/vertical offsets, angle, and size are independently adjustable. Ventilation can cover the whole faceplate, or be limited to either side of, or above and below, the device cage.
  • Add ventilation grids to the top/bottom and/or sides of a device cage. The pattern, horizontal/vertical offsets, angle, and size are independently adjustable.

Create Custom Rackmount Enclosures For Small Projects

  • Create a cage with solid sides and back, and with a top that includes screw tabs for attaching a lid.
  • The rear of a cage can be made solid and accept left oriented, centered, and/or right oriented modifications just like the faceplate. Create custom enclosures with connectors both inside and outside the rack.

Custom Faceplate Generation Without Device Cages

  • Create a custom faceplate without a cage, in any height from 0.5U to 5.0U in half-unit increments.
  • Faceplates can be ventilated as well. The pattern, horizontal/vertical offsets, angle, and size are independently adjustable.
  • Add a faceplate modification, centered on the faceplate, which can be any one of the following:
  • Keystone module receptacles
  • Neutrik D-Series connector cutouts
    
  • Cutouts and mounting bases with M2 screw bosses for mounting 85x58 SBCs such as Raspberry Pi. These can be mounted horizontally, or vertically with the SBC's "top"/"up" side facing left or right.
    
  • Cable management combs in two widths and two heights.
    
  • Motherboard rear-port IO shield cutouts.
    
  • Full-height or low-profile PCI slots for PC expansion cards.
    
  • Mini-ITX motherboard backplane with IO shield cutout and low-profile PCI slot.
    
  • ATX, SFX, and TFX power supplies.
    
  • 30mm, 40mm, 60mm, 80mm, 92mm, 120mm, or 140mm cooling fans
    
  • 10mm, 12mm, 16mm, 19mm, or 24mm holes for things like a pushbutton or panel-mount indicator light
    
  • Fractional-DIN cutouts in 1/32- to 1/4-DIN sizes
    
  • VESA FDMI MIS-B/-C/-D/-E/-F mounting patterns up to 200mm for attaching VESA mounting brackets to the rack or the rack to VESA mounting brackets
    
  • IEC-60309 industrial power inlet cutouts for 16A and 32A inlets
    
  • IEC AC Mains sockets and outlets - C13/C14 and C19/C20 - in both screw-mount and snap-in formats.
    
  • Up to three custom cutouts of configurable diameter for round holes or height and width for rectangular.
    
  • Left and right side modifications from cage generation can also be placed on a custom cageless faceplate - three different mods can be used at one time.
  • Faceplate modifications can be placed into an array or grid of up to 12 columns by 4 rows, space permitting.
  • Faceplates can be generated as flat 2D objects for export - perfect for engraving or laser-cutting a customized faceplate.

Wide Printer Support, Including Small-Format

  • Adjustable clearance setting allows for "dialing in" dimensions to compensate for the dimensional accuracy of the printer.
  • Can split a cage in half for printing on smaller-volume printers - print a 10" wide 2U tall cage within a 180mm print area. Split cages receive tabs and slots for attaching the halves together.
  • Optionally add alignment pin holes to split cages - use small 1.75mm filament "pegs" to more accurately align the cage halves.
  • Can separate the cage proper and faceplate into two components for faster printing on larger printers. Reduces print time by as much as 15% and reduces filament consumption by as much as 25%. (Separated cage should be attached to its faceplate with 1.75mm filament segments or M2 screws, and a suitable adhesive such as epoxy is used to "weld" the two into a single unit.)

Making Cage Design Easier Without Requiring CAD Expertise

  • Includes presets for a number of popular devices - simply pick a device from a list to get a ready-to-render design for a 10" rack without requiring any further action. Pick, render, export, slice, print, install into the rack.
  • Includes built-in "ruler" for easier layout. The ruler function automatically switches off when rendering a completed cage for printing.
  • Ruler feature provides a "top" indicator as well as the unit height of the generated cage.
  • Faceplate and cage-back modifications' reservation spaces are color-coded for easier layout planning.
  • Automatically marks estimated print height for the Z-axis when the ruler is enabled.
  • Optionally display an outline of the build volume of the printer, to help determine whether the resulting 3D object will fit the printer's working area.
  • Intelligent problem detection warns of size/fitment issues and overlap, in order to make sure the cage will work as a real thing before spending the time and filament to print the cage.
  • Error messages are sent to OpenSCAD's console.
  • Also runs in OpenSCAD Playground, a web-based port of OpenSCAD - design cages in a browser without having to install any software. OpenSCAD Playground can run in most modern browsers, including those that run on Android/iPhone.
u/WebMaka — 12 days ago