Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.

Commit 6a21899

Browse files
authored
Merge pull request #3 from orbingol/devmaster
Bug fixes and updates
2 parents 8f696f9 + 8129d81 commit 6a21899

23 files changed

+2623
-2682
lines changed

FUNCTION_REFERENCE.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* api_sheet_from_ff
2929
* api_boolean_chop_body
3030

31-
## Topology
31+
## Entity
3232

3333
### Classes
3434

@@ -42,11 +42,6 @@
4242
* COEDGE
4343
* VERTEX
4444
* WIRE
45-
46-
## Geometry
47-
48-
### Classes
49-
5045
* SURFACE
5146
* CONE
5247
* PLANE
@@ -64,8 +59,6 @@
6459
* SPAvector
6560
* SPAunit_vector
6661

67-
## Geometric Operators
68-
6962
### Functions
7063

7164
* translate_transf
@@ -99,17 +92,17 @@
9992

10093
## Sweeping
10194

102-
### Functions
103-
104-
* api_make_sweep_path
105-
* api_sweep_with_options
106-
10795
### Classes / Enums
10896

10997
* sweep_bool_type
11098
* sweep_options
11199
* make_sweep_path_options
112100

101+
### Functions
102+
103+
* api_make_sweep_path
104+
* api_sweep_with_options
105+
113106
## Licensing
114107

115108
### Functions

examples/01_generate_solid_block.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Please see the LICENSE file for details.
88
"""
99

10-
from ACIS import Modeler, Licensing, SaveRestore, Topology, Lists, GeometricAtoms
10+
from ACIS import Modeler, Licensing, SaveRestore, Entity, Lists, GeometricAtoms
1111

1212
# Start ACIS Modeler
1313
Modeler.api_start_modeller(0)
@@ -19,7 +19,7 @@
1919
# Generate a simple solid block
2020
pt1 = GeometricAtoms.SPAposition(0.0, 0.0, 0.0)
2121
pt2 = GeometricAtoms.SPAposition(50.0, 50.0, 25.0)
22-
block = Topology.BODY()
22+
block = Entity.BODY()
2323

2424
Modeler.api_solid_block(pt1, pt2, block)
2525

examples/02_boolean_subtract.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

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

12-
from ACIS import Modeler, Licensing, SaveRestore, Topology, Lists, GeometricAtoms, GeometricOperators
12+
from ACIS import Modeler, Licensing, SaveRestore, Entity, Lists, GeometricAtoms
1313

1414
# Start ACIS Modeler
1515
Modeler.api_start_modeller(0)
@@ -19,21 +19,21 @@
1919
Licensing.spa_unlock_products(unlock_key)
2020

2121
# Make a cuboid
22-
block = Topology.BODY()
22+
block = Entity.BODY()
2323
Modeler.api_make_cuboid(150, 75, 25, block)
2424

2525
# Generate and apply transformation to the cuboid
2626
block_vector = GeometricAtoms.SPAvector(0.0, 0.0, 12.7)
27-
block_transf = GeometricOperators.translate_transf(block_vector)
27+
block_transf = GeometricAtoms.translate_transf(block_vector)
2828
Modeler.api_apply_transf(block, block_transf)
2929

3030
# Make a frustum
31-
cylinder = Topology.BODY()
31+
cylinder = Entity.BODY()
3232
Modeler.api_make_frustum(19.05, 12.7, 12.7, 12.7, cylinder)
3333

3434
# Generate and apply transformation to the frustum
3535
cylinder_vector = GeometricAtoms.SPAvector(0.0, 0.0, 6.35)
36-
cylinder_transf = GeometricOperators.translate_transf(cylinder_vector)
36+
cylinder_transf = GeometricAtoms.translate_transf(cylinder_vector)
3737
Modeler.api_apply_transf(cylinder, cylinder_transf)
3838

3939
# Subtract frustum from cuboid

examples/03_sweeping.py

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
"""
2+
Examples for the Python 3 wrapper module for Spatial Corporation's 3D ACIS Modeler
3+
4+
ACIS and SAT are registered trademarks of Spatial Corporation.
5+
6+
The Python module is developed by Onur R. Bingol and released under MIT license.
7+
Please see the LICENSE file for details.
8+
"""
9+
10+
from ACIS import Modeler, Licensing, SaveRestore, Entity, Lists, GeometricAtoms, Sweeping, Query
11+
12+
# Start ACIS Modeler
13+
Modeler.api_start_modeller(0)
14+
15+
# Unlock ACIS Modeler components
16+
unlock_key = "Your ACIS Unlock Key here"
17+
Licensing.spa_unlock_products(unlock_key)
18+
19+
# Make a cuboid
20+
block = Entity.BODY()
21+
Modeler.api_make_cuboid(150, 75, 25, block)
22+
23+
# Get faces of the cuboid
24+
face_list = Lists.ENTITY_LIST()
25+
Query.api_get_faces(block, face_list)
26+
27+
# Choose any face from the cuboid's face list
28+
block_face = face_list.first()
29+
30+
# Convert the chosen face into a sheet body
31+
sheet_body = Entity.BODY()
32+
Modeler.api_sheet_from_ff([block_face], sheet_body)
33+
34+
# Make a sweep path
35+
pt1 = GeometricAtoms.SPAposition(0.0, 0.0, 0.0)
36+
pt2 = GeometricAtoms.SPAposition(10.0, 55.0, 23.0)
37+
sweep_path = Entity.EDGE()
38+
Sweeping.api_make_sweep_path([pt1, pt2], sweep_path)
39+
40+
# Sweep the chosen face using the sweep path
41+
opts = Sweeping.sweep_options()
42+
swept_body = Entity.BODY()
43+
Sweeping.api_sweep_with_options(sheet_body, sweep_path, opts, swept_body)
44+
45+
# Assign attributes after generation
46+
sheet_body.name = "Swept FACE"
47+
sheet_body.id = 1
48+
49+
# Prepare for saving
50+
save_list = Lists.ENTITY_LIST()
51+
# api_sweep_with_options will modify sheet_body object as defined in its documentation
52+
save_list.add(sheet_body)
53+
54+
# Set file name
55+
filename = "ACIS_Ex03.SAT"
56+
57+
# ACIS requires FileInfo object to be set before saving SAT files
58+
file_info = SaveRestore.FileInfo()
59+
file_info.set_product_id(filename)
60+
file_info.set_units(1.0) # milimeters
61+
62+
SaveRestore.api_set_file_info(file_info, product_id=True, units=True)
63+
64+
# Save the model as a SAT file
65+
SaveRestore.api_save_entity_list(filename, True, save_list)
66+
67+
# Stop ACIS Modeler
68+
Modeler.api_stop_modeller()

0 commit comments

Comments
 (0)