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
373 changes: 23 additions & 350 deletions CMakeLists.txt

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,9 @@ I would like to introduce some rules on contributing to this module.

#### Naming conventions in the Python module

* Python objects are defined as `ACIS_{ModuleName}_{ACISName}` and located in the header files
* Type functions are defined as `ACIS_{ModuleName}_{function_name}_{ACISName}`, e.g. _ACIS_GeometricAtoms_init_SPAposition_
* Methods for types are defined as `ACIS_{ModuleName}_method_{ACISName}_{MethodName}`, e.g. _ACIS_Lists_method_ENTITY_LIST_add_ which corresponds to _ENTITY_LIST::add()_ on the C++ side
* Module variables are defined as `ACIS_{ModuleName}_{function_name}`, e.g. _ACIS_Topology_module_
* Module init functions are defined as `PyInit_{ModuleName}`
* ACIS API calls are defined as `ACIS_{API Call}`, e.g. _ACIS_api_start_modeller_ which corresponds to _api_start_modeller()_ on the C++ side
* Type functions: `a3dp_{ACISName}_{function_name}`, e.g. _a3dp_SPAposition_init_ which corresponds to Python's _tp_init_ function.
* Methods for types: `a3dp_{ACISName}__{MethodName}`, e.g. _a3dp_ENTITY_LIST__add_ which corresponds to _ENTITY_LIST::add()_ on the C++ side
* ACIS API calls: `a3dp_{API-Call}`, e.g. _a3dp_api_start_modeller_ which corresponds to _api_start_modeller()_ on the C++ side

### Contribution in general

Expand Down
121 changes: 37 additions & 84 deletions FUNCTION_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

**Note:** Some class methods might be missing. Please see [CONTRIBUTING](CONTRIBUTING.md) file for details.

## Modeler

### Functions
## API Calls

* spa_unlock_products
* api_start_modeller (api_start_modeler)
* api_stop_modeller (api_stop_modeler)
* is_modeler_started
Expand All @@ -22,42 +21,6 @@
* api_apply_transf
* api_remove_transf
* api_sheet_from_ff

## Entity

### Classes

* ENTITY
* BODY
* LUMP
* SHELL
* SUBSHELL
* FACE
* EDGE
* COEDGE
* VERTEX
* WIRE
* SURFACE
* CONE
* PLANE
* SPHERE
* SPLINE
* TORUS

## Geometric Atoms

### Classes

* SPAposition
* SPAtransf
* SPAmatrix
* SPAvector
* SPAunit_vector
* SPApar_pos
* SPApar_vec

### Functions

* coordinate_transf
* make_transf
* reflect_transf
Expand All @@ -78,63 +41,53 @@
* get_resnor
* distance_to_point
* distance_to_point_squared

## Lists

### Classes

* ENTITY_LIST

## Query

### Functions

* get_owner_transf
* api_get_faces
* api_get_edges

## Save & Restore

### Classes

* FileInfo

### Functions

* api_save_entity_list
* api_set_file_info
* api_get_file_info
* api_save_version

## Sweeping

### Classes / Enums

* sweep_bool_type
* sweep_options
* make_sweep_path_options

### Functions

* api_unite
* api_intersect
* api_subtract
* api_imprint
* api_boolean_chop_body
* api_make_sweep_path
* api_sweep_with_options

## Licensing

### Functions

* spa_unlock_products
## Classes

## Booleans
* ENTITY
* BODY
* LUMP
* SHELL
* SUBSHELL
* FACE
* EDGE
* COEDGE
* VERTEX
* WIRE
* SURFACE
* CONE
* PLANE
* SPHERE
* SPLINE
* TORUS
* ENTITY_LIST
* SPAposition
* SPAtransf
* SPAmatrix
* SPAvector
* SPAunit_vector
* SPApar_pos
* SPApar_vec
* FileInfo
* sweep_options
* make_sweep_path_options

### Enums
## Enums

* sweep_bool_type
* NDBOOL_KEEP

### Functions

* api_unite
* api_intersect
* api_subtract
* api_imprint
* api_boolean_chop_body
18 changes: 9 additions & 9 deletions examples/01_generate_solid_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
"""

from ACIS import utilities as utils
from ACIS import Modeler, Licensing, SaveRestore, Entity, Lists, GeometricAtoms
from ACIS import Modeler

# Start ACIS Modeler
Modeler.api_start_modeller(0)

# Unlock ACIS Modeler components
unlock_key = utils.read_spa_license_key("license.txt")
Licensing.spa_unlock_products(unlock_key)
Modeler.spa_unlock_products(unlock_key)

# Generate a simple solid block
pt1 = GeometricAtoms.SPAposition(0.0, 0.0, 0.0)
pt2 = GeometricAtoms.SPAposition(50.0, 50.0, 25.0)
block = Entity.BODY()
pt1 = Modeler.SPAposition(0.0, 0.0, 0.0)
pt2 = Modeler.SPAposition(50.0, 50.0, 25.0)
block = Modeler.BODY()

Modeler.api_solid_block(pt1, pt2, block)

Expand All @@ -29,24 +29,24 @@
block.id = 1

# Prepare for saving
save_list = Lists.ENTITY_LIST()
save_list = Modeler.ENTITY_LIST()
save_list.add(block)

# Set file name
filename = "ACIS_Ex01.SAT"

# ACIS requires FileInfo object to be set before saving SAT files
file_info = SaveRestore.FileInfo()
file_info = Modeler.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)
Modeler.api_set_file_info(file_info, product_id=True, units=True)

## Enable sequence numbers (i.e., pointers) in the SAT file for debugging (optional step)
#Modeler.api_set_int_option("sequence_save_files", 1)

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

# Stop ACIS Modeler
Modeler.api_stop_modeller()
24 changes: 12 additions & 12 deletions examples/02_boolean_subtract.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@
# This example is taken from the book "Rapid Prototyping and Engineering Applications" by Frank W. Liou (Example 5.1)

from ACIS import utilities as utils
from ACIS import Modeler, Licensing, SaveRestore, Entity, Lists, GeometricAtoms, Booleans
from ACIS import Modeler

# Start ACIS Modeler
Modeler.api_start_modeller(0)

# Unlock ACIS Modeler components
unlock_key = utils.read_spa_license_key("license.txt")
Licensing.spa_unlock_products(unlock_key)
Modeler.spa_unlock_products(unlock_key)

# Make a cuboid
block = Entity.BODY()
block = Modeler.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 = GeometricAtoms.translate_transf(block_vector)
block_vector = Modeler.SPAvector(0.0, 0.0, 12.7)
block_transf = Modeler.translate_transf(block_vector)
Modeler.api_apply_transf(block, block_transf)

# Make a frustum
cylinder = Entity.BODY()
cylinder = Modeler.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 = GeometricAtoms.translate_transf(cylinder_vector)
cylinder_vector = Modeler.SPAvector(0.0, 0.0, 6.35)
cylinder_transf = Modeler.translate_transf(cylinder_vector)
Modeler.api_apply_transf(cylinder, cylinder_transf)

# Subtract frustum from cuboid
Expand All @@ -45,24 +45,24 @@
block.id = 1

# Prepare for saving
save_list = Lists.ENTITY_LIST()
save_list = Modeler.ENTITY_LIST()
save_list.add(block)

# Set file name
filename = "ACIS_Ex02.SAT"

# ACIS requires FileInfo object to be set before saving SAT files
file_info = SaveRestore.FileInfo()
file_info = Modeler.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)
Modeler.api_set_file_info(file_info, product_id=True, units=True)

## Enable sequence numbers (i.e., pointers) in the SAT file for debugging (optional step)
#Modeler.api_set_int_option("sequence_save_files", 1)

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

# Stop ACIS Modeler
Modeler.api_stop_modeller()
34 changes: 17 additions & 17 deletions examples/03_sweeping.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,62 +8,62 @@
"""

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

# Start ACIS Modeler
Modeler.api_start_modeller(0)

# Unlock ACIS Modeler components
unlock_key = utils.read_spa_license_key("license.txt")
Licensing.spa_unlock_products(unlock_key)
Modeler.spa_unlock_products(unlock_key)

# Make a cuboid
block = Entity.BODY()
block = Modeler.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)
face_list = Modeler.ENTITY_LIST()
Modeler.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()
sheet_body = Modeler.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)
pt1 = Modeler.SPAposition(0.0, 0.0, 0.0)
pt2 = Modeler.SPAposition(10.0, 55.0, 23.0)
sweep_path = Modeler.EDGE()
Modeler.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)
opts = Modeler.sweep_options()
swept_body = Modeler.BODY()
Modeler.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()
save_list = Modeler.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 = Modeler.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)
Modeler.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)
Modeler.api_save_entity_list(filename, True, save_list)

# Stop ACIS Modeler
Modeler.api_stop_modeller()
Loading