Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions FUNCTION_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* api_sheet_from_ff
* api_boolean_chop_body

## Topology
## Entity

### Classes

Expand All @@ -42,11 +42,6 @@
* COEDGE
* VERTEX
* WIRE

## Geometry

### Classes

* SURFACE
* CONE
* PLANE
Expand All @@ -64,8 +59,6 @@
* SPAvector
* SPAunit_vector

## Geometric Operators

### Functions

* translate_transf
Expand Down Expand Up @@ -99,17 +92,17 @@

## Sweeping

### Functions

* api_make_sweep_path
* api_sweep_with_options

### Classes / Enums

* sweep_bool_type
* sweep_options
* make_sweep_path_options

### Functions

* api_make_sweep_path
* api_sweep_with_options

## Licensing

### Functions
Expand Down
4 changes: 2 additions & 2 deletions examples/01_generate_solid_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Please see the LICENSE file for details.
"""

from ACIS import Modeler, Licensing, SaveRestore, Topology, Lists, GeometricAtoms
from ACIS import Modeler, Licensing, SaveRestore, Entity, Lists, GeometricAtoms

# Start ACIS Modeler
Modeler.api_start_modeller(0)
Expand All @@ -19,7 +19,7 @@
# Generate a simple solid block
pt1 = GeometricAtoms.SPAposition(0.0, 0.0, 0.0)
pt2 = GeometricAtoms.SPAposition(50.0, 50.0, 25.0)
block = Topology.BODY()
block = Entity.BODY()

Modeler.api_solid_block(pt1, pt2, block)

Expand Down
10 changes: 5 additions & 5 deletions examples/02_boolean_subtract.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# This example is taken from the book "Rapid Prototyping and Engineering Applications" by Frank W. Liou (Example 5.1)

from ACIS import Modeler, Licensing, SaveRestore, Topology, Lists, GeometricAtoms, GeometricOperators
from ACIS import Modeler, Licensing, SaveRestore, Entity, Lists, GeometricAtoms

# Start ACIS Modeler
Modeler.api_start_modeller(0)
Expand All @@ -19,21 +19,21 @@
Licensing.spa_unlock_products(unlock_key)

# Make a cuboid
block = Topology.BODY()
block = Entity.BODY()
Modeler.api_make_cuboid(150, 75, 25, block)

# Generate and apply transformation to the cuboid
block_vector = GeometricAtoms.SPAvector(0.0, 0.0, 12.7)
block_transf = GeometricOperators.translate_transf(block_vector)
block_transf = GeometricAtoms.translate_transf(block_vector)
Modeler.api_apply_transf(block, block_transf)

# Make a frustum
cylinder = Topology.BODY()
cylinder = Entity.BODY()
Modeler.api_make_frustum(19.05, 12.7, 12.7, 12.7, cylinder)

# Generate and apply transformation to the frustum
cylinder_vector = GeometricAtoms.SPAvector(0.0, 0.0, 6.35)
cylinder_transf = GeometricOperators.translate_transf(cylinder_vector)
cylinder_transf = GeometricAtoms.translate_transf(cylinder_vector)
Modeler.api_apply_transf(cylinder, cylinder_transf)

# Subtract frustum from cuboid
Expand Down
68 changes: 68 additions & 0 deletions examples/03_sweeping.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
"""
Examples for the Python 3 wrapper module for Spatial Corporation's 3D ACIS Modeler

ACIS and SAT are registered trademarks of Spatial Corporation.

The Python module is developed by Onur R. Bingol and released under MIT license.
Please see the LICENSE file for details.
"""

from ACIS import Modeler, Licensing, SaveRestore, Entity, Lists, GeometricAtoms, Sweeping, Query

# Start ACIS Modeler
Modeler.api_start_modeller(0)

# Unlock ACIS Modeler components
unlock_key = "Your ACIS Unlock Key here"
Licensing.spa_unlock_products(unlock_key)

# Make a cuboid
block = Entity.BODY()
Modeler.api_make_cuboid(150, 75, 25, block)

# Get faces of the cuboid
face_list = Lists.ENTITY_LIST()
Query.api_get_faces(block, face_list)

# Choose any face from the cuboid's face list
block_face = face_list.first()

# Convert the chosen face into a sheet body
sheet_body = Entity.BODY()
Modeler.api_sheet_from_ff([block_face], sheet_body)

# Make a sweep path
pt1 = GeometricAtoms.SPAposition(0.0, 0.0, 0.0)
pt2 = GeometricAtoms.SPAposition(10.0, 55.0, 23.0)
sweep_path = Entity.EDGE()
Sweeping.api_make_sweep_path([pt1, pt2], sweep_path)

# Sweep the chosen face using the sweep path
opts = Sweeping.sweep_options()
swept_body = Entity.BODY()
Sweeping.api_sweep_with_options(sheet_body, sweep_path, opts, swept_body)

# Assign attributes after generation
sheet_body.name = "Swept FACE"
sheet_body.id = 1

# Prepare for saving
save_list = Lists.ENTITY_LIST()
# api_sweep_with_options will modify sheet_body object as defined in its documentation
save_list.add(sheet_body)

# Set file name
filename = "ACIS_Ex03.SAT"

# ACIS requires FileInfo object to be set before saving SAT files
file_info = SaveRestore.FileInfo()
file_info.set_product_id(filename)
file_info.set_units(1.0) # milimeters

SaveRestore.api_set_file_info(file_info, product_id=True, units=True)

# Save the model as a SAT file
SaveRestore.api_save_entity_list(filename, True, save_list)

# Stop ACIS Modeler
Modeler.api_stop_modeller()
Loading