Download AngelScript CSG version V2.0-02, with IDE included
Windows 64bit here.
Linux (K)ubuntu 15.10 64bit here.
AngelScript CSG is a work in progress, see the previous articles on this blog. Today's article is providing practical information on installing and using the software.
Windows 64bit
The AngelScript CSG setup package will install the script compiler as_csg.exe and the editor/IDE as_ide.exe.
Linux (K)ubuntu 15.10 64bit
The angelscript_csg.tar.gz contains the binaries for AngelScript CSG script compiler as_csg and the editor/IDE as_ide. Extract the contents to a suitable folder ~/angelscript_csg is recommended.
export PATH=$PATH:~/angelscript_csg export LD_LIBRARY_PATH==LD_LIBRARY_PATH=:~/angelscript_csg |
A small taste of the AngelScript language
If you are familiar with C, C++ or similar languages the learning curve will be short and painless. AngelScript is similar in most respects. A relatively complete description of the general language is found here, but as a short primer here are a few key points to know
The language is strongly typed, variables must be declared with a type as in C or C++
Line comment lines are preceded by double slash //
Comment blocks begin with /*
and end with */ There are two forms of objects, reference types and value types.
The value types are like the primitives
int i doble pi = 3.13159; |
The reference types uses object handles. Object handles are used to hold references to other objects. When calling methods or accessing properties on a variable that is an object handle you will be accessing the actual object that the handle references, just as if it was an alias.
double radius = 3; sphere@ s cylinder@ s = cylinder(10,radius); cylinder@ s2 = @s; // 2nd handle to same cylinder |
Functions are defined as in C/C++, returning value types or reference types
double sum(double a, double b) { } |
solid@ sum(cylinder@ c, sphere@ s) |
Arrays may be defined for value types or reference types
int[] iarr = {0,1,2,3,4,5}; solid@[] sarr = { cylinder(10,3), sphere(3) };
// build a growing array of spheres with increasing radius sphere@[] spheres; for(int i=0; i<10; i++) spheres.push_back(sphere(i));
// report the size of the array to terminal (answer will be 10) cout << spheres.size() << endl(); |
The above is just a small taste of the language. If it catches your interest, you may want to look at the the full language description for more details. Remember also that withing the AngelScript CSG IDE you can use Help → View Documentation to find more specifics on how to construct the various CSG objects that are not described in the general AngelScript language description.
Another topic is transformations, but we leave that for another day.
Haulalljeh! I needed this-you’re my savior.