KeithSloan / OpenSCAD_Alt_Import

Inprocess : Installable version of FreeCAD OpenSCAD workbench
Other
10 stars 6 forks source link

Alternate OpenSCAD Importer

NOTICES

Functions such as PrismaticToroid require facilities in the FreeCAD version 0.20 of Part

Installation

It can be installed via the Addon Manager (from Tools menu)

Alternative Installation

Clone into FreeCAD's Mod directory see https://wiki.freecadweb.org/Installing_more_workbenches

Now supports

The idea to allow hybrid development ( FreeCAD and OpenSCAD )

New OpenSCAD DXF importer

External Editor

For a number of years OpenSCAD has supported an External Editor

To use an external editor for SCADObjects

You need to add a parameter to the OpenSCAD workbench

  FreeCAD | Tools | Edit parameters

  Group : Base App
      Preferences
         Mod
            OpenSCAD
                externalEditor
                    Text : <path to editor > 
                    e.g. Text /usr/local/bin/code

Use

With the workbench installed when opening a CSG or SCAD File with

    FreeCAD | File | Open 

the user will be prompted with which importer to use.

Image 20-02-2023 at 14 29

Minkowski requests where the second object is a Sphere or Cyclinder is handled as follows

Sphere

$fn=50;
minkowski()
  {
    cube([10,10,1]);
    sphere(1);
  }

Produces a suitable Part::Offset of the first Object i.e with rounded edges.

Image 01-03-2023 at 09 04

Cylinder

$fn=50;
minkowski()
  {
    cube([10,10,1]);
    cylinder(r=2,h=1);
  }

Produces an Part::Fillet of a suitable Part::Offset of the first Object, fillet radius that of the cylinder.

Image 01-03-2023 at 09 08

Where the FreeCAD has an editable Fillet

Image 01-03-2023 at 09 09

Example Screenshot. Image 20-02-2023 at 14 02

Advantage of using an external editor that is also setup for OpenSCAD

The performance of OpenSCAD Preview has been significantly improved since Feb 2022

OpenSCAD 3D rendering just got an order of magnitude faster

Thanks to FreeCAD Users