Skip to content

Commit

Permalink
Merge branch 'release/0.7.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
mkeeter committed Apr 8, 2015
2 parents 24e0c00 + 43d5c8c commit 27fe5f6
Show file tree
Hide file tree
Showing 399 changed files with 83,849 additions and 1,212 deletions.
2 changes: 1 addition & 1 deletion BUILDING.md
Expand Up @@ -34,7 +34,7 @@ sudo apt-get install build-essential
sudo apt-get install libpng-dev
sudo apt-get install python3-dev
sudo apt-get install libboost-all-dev
sudo apt-get install mesa-common-dev libgd-dev
sudo apt-get install libgl1-mesa-dev-lts-utopic
git clone https://github.com/mkeeter/antimony
cd antimony
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes.
5 changes: 3 additions & 2 deletions app/deploy_app.sh → deploy/mac/deploy.sh
Expand Up @@ -8,7 +8,7 @@ fi

RELEASE=`git describe --exact-match --tags || echo "($(git rev-parse --abbrev-ref HEAD))"`

cd ../build-$1
cd ../../build-$1
make clean
make qmake
rm -rf antimony.app
Expand Down Expand Up @@ -40,11 +40,12 @@ cd ../../..
cp -r sb/fab antimony.app/Contents/Frameworks/Python.framework/Versions/3.4/lib/python3.4/fab
cp -r sb/nodes antimony.app/Contents/Resources

sed -i "" "s/0\.0\.0/$RELEASE/g" antimony.app/Contents/Info.plist
sed -i "" "s:0\.0\.0:$RELEASE:g" antimony.app/Contents/Info.plist

mkdir antimony
cp ../README.md ./antimony/README.txt
cp ../doc/USAGE.md ./antimony/USAGE.txt
cp ../doc/SCRIPTING.md ./antimony/SCRIPTING.txt
mv antimony.app ./antimony
hdiutil create antimony.dmg -volname "Antimony $RELEASE" -srcfolder antimony
rm -rf antimony
File renamed without changes.
File renamed without changes.
55 changes: 55 additions & 0 deletions doc/SCRIPTING.md
@@ -0,0 +1,55 @@
Scripting in Antimony
=====================

Every Antimony node is implemented as a Python script.

Scripts are Python 3.x with a few extra functions and modules.

I/O functions
-------------
- `input(name, type)` creates an input datum of the given type
and injects it into the namespace. `name` must be a string
and `type` must be either `float`, `int`, or `fab.types.Shape`
(or simply `Shape` depending on how it was imported).
- `output(name, value)` creates an output datum with the given name and value
(the type is automatically determined and must be either `float` or `Shape`)
- `title(value)` sets the title of the node,
which is shown in a graph window in the upper-right corner of the node.

Note that `input` and `output` will create new rows in the graph view
for the datums that they add to the node.

`fab` module
------------
Python scripts will usually import the `fab` module, which has
Antimony-specific classes and types for designing shapes.

### `fab.shapes`
`fab.shapes` contains a standard library of primitives and transforms.
It is populated from [shapes.py](../py/fab/shapes.py).

### `fab.types`
`fab.types` contains Python classes representing various Antimony types.
The most relevant is `fab.types.Shape`, which represents a 2D or 3D
solid body. It is often used as the second argument to `input`, i.e.
`input(s, fab.types.Shape)` to declare a `Shape` input port.

Other types include `Bounds` (representing 2D or 3D bounds) and
`Transform` (representing a coordinate transform).

### `fab.ui`
`fab.ui` contains magic functions that modify the user interface in
3D viewports. The relevant functions are `fab.ui.wireframe` and
`fab.ui.point`. Both have detailed docstrings and are used extensively
in the standard node library; check out existing nodes to get an idea
of how they can be used.

`meta` object
-------------
At the moment, the `meta` object is only used for nodes that define export
tasks. It has two relevant functions: `meta.export_stl` and
`meta.export_heightmap`. When called, each will add a arrow icon to the
top right of the node's representation in the graph; clicking on this arrow
will run the export task. Both export functions have extensive documentation;
check out the existing export nodes for an example of how they are used.

37 changes: 19 additions & 18 deletions doc/USAGE.md
Expand Up @@ -3,10 +3,12 @@ User's Guide to Antimony

Antimony is a tool for computer-aided design (CAD).

Window types
------------

There are three window types, each of which gives a different perspective on the scene.

Graph window
------------
### Graph window
The graph window shows a graph representation of the current model.

Pan with the left mouse button;
Expand Down Expand Up @@ -39,8 +41,7 @@ While dragging, pressing Spacebar will snap the connection to the nearest valid

Any shape datum with an unconnected output port will be rendered.

3D viewport
-----------
### 3D viewport
The 3D viewport shows a 2D or 3D view of the current model.
It is rendered and refined in real time.

Expand All @@ -60,8 +61,7 @@ These controls can be dragged with the left mouse button.
If multiple controls are overlapping,
right-clicking will open up a list and one can be chosen to raise above the others.

Script editor
-------------
### Script editor
A script editor is used to edit the Python code of a Script node.
To open the script editor,
add a Script node in the graph view
Expand All @@ -78,15 +78,16 @@ or an error occurred respectively).

When an error occurs, the relevant line will be highlighted in red.

Scripting is standard Python 3.x with a few extra functions:
- `input(name, type)` creates an input datum of the given type
and injects it into the namespace. `name` must be a string
and `type` must be either `float`, `int`, or `fab.types.Shape`
(or simply `Shape` depending on how it was imported).
- `output(name, value)` creates an output datum with the given name and value
(the type is automatically determined and must be either `float` or `Shape`)
- `title(value)` sets the title of the node,
which is shown in a graph window in the upper-right corner of the node.

Note that `input` and `output` will create new rows in the graph view
for the datums that they add to the node.
Exporting files
---------------
The export workflow in Antimony is a bit non-traditional.

To export a particular shape, create a node from the Export category then
connect the target shape to its input port. If the shape is a valid target
for export, a right-pointing arrow icon will appear in the top right corner
of the node's graph representation; clicking on this arrow will start the
export task.

This means that multiple export tasks can be defined for different parts of
a model; details like resolution and even target filename can also be
hard-coded by editing the export node's script.
19 changes: 19 additions & 0 deletions doc/release-notes/0.7.9.md
@@ -0,0 +1,19 @@
Antimony 0.7.9
--------------

**Features:**
- Dramatic speedup in mesh export
- Added experimental feature detection to mesh export
(which finds edges and corners and pushes a vertex to keep them sharp)
- Another major speedup in loading large files
- Made export workflow more flexible:
- In the graph view, create a node from the `Export` node category
- Attach shapes to its inputs
- Click the small arrow in the upper right of the node to run the export task
- Added 'Jump to node' on right-click (in either 3D or graph views)
- Improved documentation

**Bugfixes:**
- Fixed a few memory leaks of Python objects
- Cancelling an export with Escape now actually stops the export task
- Changed the way that images are drawn to prevent (?) `QGraphicsScene` crashes
8 changes: 8 additions & 0 deletions py/nodes/Export/export_heightmap.node
@@ -0,0 +1,8 @@
import fab

title('Heightmap (.png)')

input('input', fab.types.Shape)
output('shape', input)

meta.export_heightmap(input)
8 changes: 8 additions & 0 deletions py/nodes/Export/export_stl.node
@@ -0,0 +1,8 @@
import fab

title('Mesh (.stl)')

input('input', fab.types.Shape)
output('shape', input)

meta.export_stl(input)
15 changes: 7 additions & 8 deletions qt/antimony.pro
Expand Up @@ -62,9 +62,8 @@ SOURCES += \
../src/render/render_task.cpp \
../src/render/render_worker.cpp \
../src/render/render_image.cpp \
../src/render/export_mesh.cpp \
../src/render/export_bitmap.cpp \
../src/render/export_json.cpp \
../src/export/export_mesh.cpp \
../src/export/export_heightmap.cpp \

HEADERS += \
../src/ui/main_window.h \
Expand Down Expand Up @@ -101,9 +100,9 @@ HEADERS += \
../src/render/render_task.h \
../src/render/render_worker.h \
../src/render/render_image.h \
../src/render/export_mesh.h \
../src/render/export_bitmap.h \
../src/render/export_json.h \
../src/export/export_mesh.h \
../src/export/export_worker.h \
../src/export/export_heightmap.h \

FORMS += \
../src/ui/forms/main_window.ui \
Expand All @@ -114,8 +113,8 @@ RESOURCES += \
../gl/gl.qrc \

macx {
QMAKE_INFO_PLIST = ../app/Info.plist
ICON = ../app/sb.icns
QMAKE_INFO_PLIST = ../deploy/mac/Info.plist
ICON = ../deploy/mac/sb.icns
}

linux {
Expand Down
7 changes: 6 additions & 1 deletion qt/fab.pri
Expand Up @@ -3,7 +3,9 @@ SOURCES += \
../src/fab/tree/render.c \
../src/fab/tree/tree.c \
../src/fab/tree/parser.c \
../src/fab/tree/triangulate.c \
../src/fab/tree/triangulate.cpp \
../src/fab/tree/triangulate/mesher.cpp \
../src/fab/tree/triangulate/triangle.cpp \
../src/fab/tree/math/math_f.c \
../src/fab/tree/math/math_i.c \
../src/fab/tree/math/math_r.c \
Expand All @@ -27,6 +29,8 @@ HEADERS += \
../src/fab/tree/tree.h \
../src/fab/tree/parser.h \
../src/fab/tree/triangulate.h \
../src/fab/tree/triangulate/mesher.h \
../src/fab/tree/triangulate/triangle.h \
../src/fab/tree/math/math_f.h \
../src/fab/tree/math/math_i.h \
../src/fab/tree/math/math_r.h \
Expand All @@ -45,6 +49,7 @@ HEADERS += \
../src/fab/types/transform.h

INCLUDEPATH += ../src/fab
INCLUDEPATH += ../vendor
DEFINES += '_STATIC_= '

linux {
Expand Down
4 changes: 2 additions & 2 deletions qt/shared.pri
Expand Up @@ -8,9 +8,9 @@ SOURCES += \
../src/graph/datum/link.cpp \
../src/graph/node/serializer.cpp \
../src/graph/node/deserializer.cpp \
../src/graph/node/deserializer_old.cpp \
../src/graph/hooks/hooks.cpp \
../src/graph/hooks/input.cpp \
../src/graph/hooks/meta.cpp \
../src/graph/hooks/output.cpp \
../src/graph/hooks/title.cpp \
../src/graph/hooks/ui.cpp \
Expand All @@ -22,9 +22,9 @@ HEADERS += \
../src/graph/datum/link.h \
../src/graph/node/serializer.h \
../src/graph/node/deserializer.h \
../src/graph/node/deserializer_old.h \
../src/graph/hooks/hooks.h \
../src/graph/hooks/input.h \
../src/graph/hooks/meta.h \
../src/graph/hooks/output.h \
../src/graph/hooks/title.h \
../src/graph/hooks/ui.h \
Expand Down

0 comments on commit 27fe5f6

Please sign in to comment.