Author Topic: Planned new features in AngelCAD  (Read 185 times)

Carsten Arnholm

  • Administrator
  • Newbie
  • *****
  • Posts: 45
    • View Profile
Planned new features in AngelCAD
« on: 2020-09-06, 22:41:56 »
Here is a quick summary of things coming to AngelCAD. This thread is for discussing already planned features as listed. If you want to propose new features, feel free to start a new thread with a suitable subject heading.

Import of DXF files
This is not a language feature, but instead an external application (dxfread) that can be used alone, or from a new File -> Import DXF .. menu item in the AngelCAD IDE. When used, it generates an AngelCAD *.as file containing a function returning a shape2d@ object that you can use with linear_extrude, rotate_extrude, sweep etc.  For example, if you have a file "nice_drawing.dxf" and import it, you get a file "nice_drawing.as" containing a function with signature

Code: [Select]
shape2d@ nice_drawing_dxf();
In your main AngelCAD script you include the file

Code: [Select]
#include "nice_drawing.as"
And then call the nice_drawing_dxf() as required.

Support for script arguments
This allows some of the script variables to be defined outside the script. The variables become available via the the "args" input argument of the main_shape() function, and the script can extract the values as shown below and in the attached screenshot. If the variable is not provided by the user, a default value is specified in the script

Code: [Select]
// AngelCAD code.
#include "DXF447.as"

shape@ main_shape(as_args@ args)
{
   double height = args.get_unsigned_double("height",def:1.0);
   return linear_extrude(DXF447_dxf(),height);
}

Optional "post-build" export of generated files to a predefined directory
Using this option, a disk folder can be defined as the export directory for generated files, regardless of where the AngelCAD source is executed. This is a convenient feature where for example your slicer program can pick up STL files.

Processing of OpenSCAD csg files in AngelCADs xcsg engine
If you have an OpenSCAD .scad file, for example  "myfile.scad", you can use OpenSCAD to generate "myfile.csg"

$ openscad --o myfile.csg myfile.scad

The above is a fast process, even for large models because no boolean operations are involved (CGAL is not involved). Given the generated .csg file, you will then be able to use it as input to AngelCADs xcsg engine and create e.g. an STL file ! :

$ xcsg --stl myfile.csg

This can be many times faster than doing it directly in OpenSCAD. Granted, there are some limitations, not all .csg commands will be supported. This includes import,  surface, text and resize and some other things. But many models do not use these features, and sometimes this can be a big time saver. There is also a possibility that using this feature from the AngelCAD IDE might become possible, no decision yet.

« Last Edit: 2020-09-07, 10:40:38 by Carsten Arnholm »

Carsten Arnholm

  • Administrator
  • Newbie
  • *****
  • Posts: 45
    • View Profile
Re: Planned new features in AngelCAD
« Reply #1 on: 2020-09-13, 09:38:00 »
Some more info on the upcoming features:

Processing of OpenSCAD files
I have now decided to make it easier to use AngelCAD for this purpose. Simply open an OpenSCAD .scad file in the AngelCAD IDE and press the build button. Note that this requires OpenSCAD to be installed on the computer, because it is being used to convert the .scad file to .csg (a fast process even for large models). The benefit is in the much faster processing of the boolean operations in xcsg.  Also, the AngelCAD viewer (AngelView) can then be used in the usual way in this scenario.

Remember which files are open
In version 1.4 or earlier only one file would be remembered and re-opened in the next AngelCAD session. I am working on a feature to remember and restore the complete set of source files that was open in the previous session.

Discovering file edits by other programs
Potentially, a source file opened by AngelCAD could be edited and saved by some other program (e.g. Notepad++) at the same time. In version 1.4 or earlier this would not be discovered by AngelCAD. Work is ongoing to make AngelCAD detect such edits and take proper action.

Carsten Arnholm

  • Administrator
  • Newbie
  • *****
  • Posts: 45
    • View Profile
Re: Planned new features in AngelCAD
« Reply #2 on: 2020-10-13, 15:18:42 »
Some more info of upcoming features

General
"Save & Close all but this" option when right-clicking editor tab.
Linux: Now opening default file browser when opening folder
Now displaying also stderr messages from applications running in thread background (xcsg/openscad)

Search/Replace
Shortcut is now Ctrl+F like most other programs
Search now responds properly to pressing ENTER.

OpenSCAD import
OpenSCADs slightly esoteric options in 'linear_extrude', including twist,scale and slices will be supported. Also extrude with multiple children works.
Allow use of secant_tolerance (a.k.a 'sec_tol') to control discretization of imported models.
Added support for projection(cut=true).
Drag & drop of .scad files into AngelCAD IDE works.