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

Commit eee323c

Browse files
authored
Merge pull request #6 from orbingol/devmaster
Update to new codebase
2 parents 41b3280 + b142d82 commit eee323c

34 files changed

+6314
-7374
lines changed

CMakeLists.txt

Lines changed: 23 additions & 350 deletions
Large diffs are not rendered by default.

CONTRIBUTING.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,9 @@ I would like to introduce some rules on contributing to this module.
2727

2828
#### Naming conventions in the Python module
2929

30-
* Python objects are defined as `ACIS_{ModuleName}_{ACISName}` and located in the header files
31-
* Type functions are defined as `ACIS_{ModuleName}_{function_name}_{ACISName}`, e.g. _ACIS_GeometricAtoms_init_SPAposition_
32-
* 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
33-
* Module variables are defined as `ACIS_{ModuleName}_{function_name}`, e.g. _ACIS_Topology_module_
34-
* Module init functions are defined as `PyInit_{ModuleName}`
35-
* 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
30+
* Type functions: `a3dp_{ACISName}_{function_name}`, e.g. _a3dp_SPAposition_init_ which corresponds to Python's _tp_init_ function.
31+
* Methods for types: `a3dp_{ACISName}__{MethodName}`, e.g. _a3dp_ENTITY_LIST__add_ which corresponds to _ENTITY_LIST::add()_ on the C++ side
32+
* ACIS API calls: `a3dp_{API-Call}`, e.g. _a3dp_api_start_modeller_ which corresponds to _api_start_modeller()_ on the C++ side
3633

3734
### Contribution in general
3835

FUNCTION_REFERENCE.md

Lines changed: 37 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

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

5-
## Modeler
6-
7-
### Functions
5+
## API Calls
86

7+
* spa_unlock_products
98
* api_start_modeller (api_start_modeler)
109
* api_stop_modeller (api_stop_modeler)
1110
* is_modeler_started
@@ -22,42 +21,6 @@
2221
* api_apply_transf
2322
* api_remove_transf
2423
* api_sheet_from_ff
25-
26-
## Entity
27-
28-
### Classes
29-
30-
* ENTITY
31-
* BODY
32-
* LUMP
33-
* SHELL
34-
* SUBSHELL
35-
* FACE
36-
* EDGE
37-
* COEDGE
38-
* VERTEX
39-
* WIRE
40-
* SURFACE
41-
* CONE
42-
* PLANE
43-
* SPHERE
44-
* SPLINE
45-
* TORUS
46-
47-
## Geometric Atoms
48-
49-
### Classes
50-
51-
* SPAposition
52-
* SPAtransf
53-
* SPAmatrix
54-
* SPAvector
55-
* SPAunit_vector
56-
* SPApar_pos
57-
* SPApar_vec
58-
59-
### Functions
60-
6124
* coordinate_transf
6225
* make_transf
6326
* reflect_transf
@@ -78,63 +41,53 @@
7841
* get_resnor
7942
* distance_to_point
8043
* distance_to_point_squared
81-
82-
## Lists
83-
84-
### Classes
85-
86-
* ENTITY_LIST
87-
88-
## Query
89-
90-
### Functions
91-
9244
* get_owner_transf
9345
* api_get_faces
9446
* api_get_edges
95-
96-
## Save & Restore
97-
98-
### Classes
99-
100-
* FileInfo
101-
102-
### Functions
103-
10447
* api_save_entity_list
10548
* api_set_file_info
10649
* api_get_file_info
10750
* api_save_version
108-
109-
## Sweeping
110-
111-
### Classes / Enums
112-
113-
* sweep_bool_type
114-
* sweep_options
115-
* make_sweep_path_options
116-
117-
### Functions
118-
51+
* api_unite
52+
* api_intersect
53+
* api_subtract
54+
* api_imprint
55+
* api_boolean_chop_body
11956
* api_make_sweep_path
12057
* api_sweep_with_options
12158

122-
## Licensing
123-
124-
### Functions
12559

126-
* spa_unlock_products
60+
## Classes
12761

128-
## Booleans
62+
* ENTITY
63+
* BODY
64+
* LUMP
65+
* SHELL
66+
* SUBSHELL
67+
* FACE
68+
* EDGE
69+
* COEDGE
70+
* VERTEX
71+
* WIRE
72+
* SURFACE
73+
* CONE
74+
* PLANE
75+
* SPHERE
76+
* SPLINE
77+
* TORUS
78+
* ENTITY_LIST
79+
* SPAposition
80+
* SPAtransf
81+
* SPAmatrix
82+
* SPAvector
83+
* SPAunit_vector
84+
* SPApar_pos
85+
* SPApar_vec
86+
* FileInfo
87+
* sweep_options
88+
* make_sweep_path_options
12989

130-
### Enums
90+
## Enums
13191

92+
* sweep_bool_type
13293
* NDBOOL_KEEP
133-
134-
### Functions
135-
136-
* api_unite
137-
* api_intersect
138-
* api_subtract
139-
* api_imprint
140-
* api_boolean_chop_body

examples/01_generate_solid_block.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@
88
"""
99

1010
from ACIS import utilities as utils
11-
from ACIS import Modeler, Licensing, SaveRestore, Entity, Lists, GeometricAtoms
11+
from ACIS import Modeler
1212

1313
# Start ACIS Modeler
1414
Modeler.api_start_modeller(0)
1515

1616
# Unlock ACIS Modeler components
1717
unlock_key = utils.read_spa_license_key("license.txt")
18-
Licensing.spa_unlock_products(unlock_key)
18+
Modeler.spa_unlock_products(unlock_key)
1919

2020
# Generate a simple solid block
21-
pt1 = GeometricAtoms.SPAposition(0.0, 0.0, 0.0)
22-
pt2 = GeometricAtoms.SPAposition(50.0, 50.0, 25.0)
23-
block = Entity.BODY()
21+
pt1 = Modeler.SPAposition(0.0, 0.0, 0.0)
22+
pt2 = Modeler.SPAposition(50.0, 50.0, 25.0)
23+
block = Modeler.BODY()
2424

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

@@ -29,24 +29,24 @@
2929
block.id = 1
3030

3131
# Prepare for saving
32-
save_list = Lists.ENTITY_LIST()
32+
save_list = Modeler.ENTITY_LIST()
3333
save_list.add(block)
3434

3535
# Set file name
3636
filename = "ACIS_Ex01.SAT"
3737

3838
# ACIS requires FileInfo object to be set before saving SAT files
39-
file_info = SaveRestore.FileInfo()
39+
file_info = Modeler.FileInfo()
4040
file_info.set_product_id(filename)
4141
file_info.set_units(1.0) # milimeters
4242

43-
SaveRestore.api_set_file_info(file_info, product_id=True, units=True)
43+
Modeler.api_set_file_info(file_info, product_id=True, units=True)
4444

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

4848
# Save the model as a SAT file
49-
SaveRestore.api_save_entity_list(filename, True, save_list)
49+
Modeler.api_save_entity_list(filename, True, save_list)
5050

5151
# Stop ACIS Modeler
5252
Modeler.api_stop_modeller()

examples/02_boolean_subtract.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,31 @@
1010
# This example is taken from the book "Rapid Prototyping and Engineering Applications" by Frank W. Liou (Example 5.1)
1111

1212
from ACIS import utilities as utils
13-
from ACIS import Modeler, Licensing, SaveRestore, Entity, Lists, GeometricAtoms, Booleans
13+
from ACIS import Modeler
1414

1515
# Start ACIS Modeler
1616
Modeler.api_start_modeller(0)
1717

1818
# Unlock ACIS Modeler components
1919
unlock_key = utils.read_spa_license_key("license.txt")
20-
Licensing.spa_unlock_products(unlock_key)
20+
Modeler.spa_unlock_products(unlock_key)
2121

2222
# Make a cuboid
23-
block = Entity.BODY()
23+
block = Modeler.BODY()
2424
Modeler.api_make_cuboid(150, 75, 25, block)
2525

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

3131
# Make a frustum
32-
cylinder = Entity.BODY()
32+
cylinder = Modeler.BODY()
3333
Modeler.api_make_frustum(19.05, 12.7, 12.7, 12.7, cylinder)
3434

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

4040
# Subtract frustum from cuboid
@@ -45,24 +45,24 @@
4545
block.id = 1
4646

4747
# Prepare for saving
48-
save_list = Lists.ENTITY_LIST()
48+
save_list = Modeler.ENTITY_LIST()
4949
save_list.add(block)
5050

5151
# Set file name
5252
filename = "ACIS_Ex02.SAT"
5353

5454
# ACIS requires FileInfo object to be set before saving SAT files
55-
file_info = SaveRestore.FileInfo()
55+
file_info = Modeler.FileInfo()
5656
file_info.set_product_id(filename)
5757
file_info.set_units(1.0) # milimeters
5858

59-
SaveRestore.api_set_file_info(file_info, product_id=True, units=True)
59+
Modeler.api_set_file_info(file_info, product_id=True, units=True)
6060

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

6464
# Save the model as a SAT file
65-
SaveRestore.api_save_entity_list(filename, True, save_list)
65+
Modeler.api_save_entity_list(filename, True, save_list)
6666

6767
# Stop ACIS Modeler
6868
Modeler.api_stop_modeller()

examples/03_sweeping.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,62 +8,62 @@
88
"""
99

1010
from ACIS import utilities as utils
11-
from ACIS import Modeler, Licensing, SaveRestore, Entity, Lists, GeometricAtoms, Sweeping, Query
11+
from ACIS import Modeler
1212

1313
# Start ACIS Modeler
1414
Modeler.api_start_modeller(0)
1515

1616
# Unlock ACIS Modeler components
1717
unlock_key = utils.read_spa_license_key("license.txt")
18-
Licensing.spa_unlock_products(unlock_key)
18+
Modeler.spa_unlock_products(unlock_key)
1919

2020
# Make a cuboid
21-
block = Entity.BODY()
21+
block = Modeler.BODY()
2222
Modeler.api_make_cuboid(150, 75, 25, block)
2323

2424
# Get faces of the cuboid
25-
face_list = Lists.ENTITY_LIST()
26-
Query.api_get_faces(block, face_list)
25+
face_list = Modeler.ENTITY_LIST()
26+
Modeler.api_get_faces(block, face_list)
2727

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

3131
# Convert the chosen face into a sheet body
32-
sheet_body = Entity.BODY()
32+
sheet_body = Modeler.BODY()
3333
Modeler.api_sheet_from_ff([block_face], sheet_body)
3434

3535
# Make a sweep path
36-
pt1 = GeometricAtoms.SPAposition(0.0, 0.0, 0.0)
37-
pt2 = GeometricAtoms.SPAposition(10.0, 55.0, 23.0)
38-
sweep_path = Entity.EDGE()
39-
Sweeping.api_make_sweep_path([pt1, pt2], sweep_path)
36+
pt1 = Modeler.SPAposition(0.0, 0.0, 0.0)
37+
pt2 = Modeler.SPAposition(10.0, 55.0, 23.0)
38+
sweep_path = Modeler.EDGE()
39+
Modeler.api_make_sweep_path([pt1, pt2], sweep_path)
4040

4141
# Sweep the chosen face using the sweep path
42-
opts = Sweeping.sweep_options()
43-
swept_body = Entity.BODY()
44-
Sweeping.api_sweep_with_options(sheet_body, sweep_path, opts, swept_body)
42+
opts = Modeler.sweep_options()
43+
swept_body = Modeler.BODY()
44+
Modeler.api_sweep_with_options(sheet_body, sweep_path, opts, swept_body)
4545

4646
# Assign attributes after generation
4747
sheet_body.name = "Swept FACE"
4848
sheet_body.id = 1
4949

5050
# Prepare for saving
51-
save_list = Lists.ENTITY_LIST()
51+
save_list = Modeler.ENTITY_LIST()
5252
# api_sweep_with_options will modify sheet_body object as defined in its documentation
5353
save_list.add(sheet_body)
5454

5555
# Set file name
5656
filename = "ACIS_Ex03.SAT"
5757

5858
# ACIS requires FileInfo object to be set before saving SAT files
59-
file_info = SaveRestore.FileInfo()
59+
file_info = Modeler.FileInfo()
6060
file_info.set_product_id(filename)
6161
file_info.set_units(1.0) # milimeters
6262

63-
SaveRestore.api_set_file_info(file_info, product_id=True, units=True)
63+
Modeler.api_set_file_info(file_info, product_id=True, units=True)
6464

6565
# Save the model as a SAT file
66-
SaveRestore.api_save_entity_list(filename, True, save_list)
66+
Modeler.api_save_entity_list(filename, True, save_list)
6767

6868
# Stop ACIS Modeler
6969
Modeler.api_stop_modeller()

0 commit comments

Comments
 (0)