AngelCAD Forum (served by ABmesh)

User Forums => General Discussion => Topic started by: Carsten Arnholm on 2020-09-06, 22:41:56

Title: Planned new features in AngelCAD
Post by: Carsten Arnholm 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 "" containing a function with signature

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

Code: [Select]
#include ""
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 ""

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.

Title: Re: Planned new features in AngelCAD
Post by: Carsten Arnholm 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.
Title: Re: Planned new features in AngelCAD
Post by: Carsten Arnholm on 2020-10-13, 15:18:42
Some more info of upcoming features

"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)

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.
Title: Re: Planned new features in AngelCAD
Post by: matthest on 2021-01-13, 15:07:58
Hi Carsten, first, thanks for your effort, truly great way of working with 3D modelling!
After playing around a bit I have some general comments to Angelcad V1.5-06 running on Windows 10.

1) after each save/F6 the editor jumps to the top. Thus I have to scroll down to my code (e.g line 245 again after every rerun at the code).
2) Angelviewer update command is hidden (but pressing F6 automatically updates Angelviewer). Perhaps show how this is done in the console?

3) It would be truly interesting to add colors or somehow differentiate between parts in the code.

Title: Re: Planned new features in AngelCAD
Post by: Carsten Arnholm on 2021-01-13, 16:40:42
Hi thanks for the feedback

1) Yes I have heard this mentioned. I will look into it before next update. Thanks for bringing it up.

2) First time for a model, after F6 use Tools -> View STL/AMF/DXF to start AngelView (or use the Yellow "View model" icon in the toolbar). For subsequent updates, then AngelView should update automatically when the STL or other file is updated, AngelView monitors the file changes. You can also force the update in AngelView (File -> Reload (F6)).

3) That would require colour information in the STL or other formats, and unfortunately it does not exist. Visualisation in AngelCAD/AngelView is based on stored STL/AMF/OFF/OBJ only.
Title: Re: Planned new features in AngelCAD
Post by: matthest on 2021-01-13, 17:30:04
2) how can I call this update from command line (CMD windows) ?

3) I have not read much about STL, but this link mentions something about colors:
Title: Re: Planned new features in AngelCAD
Post by: Carsten Arnholm on 2021-01-13, 20:44:46
2) I don't understand this question
You either open the file: angelview [<input_filename>]
or if it is already open it will be automatically reloaded

3) This is not standard in any way, and it is only theoretically possible in binary STLs. I don't think it is in use anywhere. There is no such option in the other formats.