Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
c51bb93
adding test for vertex and tests based on spaceclaim tutorials
syscordan Aug 6, 2025
291d32b
chore: adding changelog file 2157.test.md [dependabot-skip]
pyansys-ci-bot Aug 6, 2025
e4d4c2f
adding tests to list of incompatible tests
syscordan Aug 11, 2025
11a0517
Merge branch 'test/syscordan_vertex_sc_tutorials' of https://github.c…
syscordan Aug 11, 2025
73a6a33
chore: adding changelog file 2157.test.md [dependabot-skip]
pyansys-ci-bot Aug 11, 2025
7132ceb
Merge branch 'main' into test/syscordan_vertex_sc_tutorials
RobPasMue Aug 18, 2025
622b3d1
fixing face index to fix failure
syscordan Aug 26, 2025
2903205
Merge branch 'test/syscordan_vertex_sc_tutorials' of https://github.c…
syscordan Aug 26, 2025
6b8c5ca
Merge branch 'main' into test/syscordan_vertex_sc_tutorials
syscordan Aug 27, 2025
3d03aa5
chore: auto fixes from pre-commit hooks
pre-commit-ci[bot] Aug 27, 2025
336b92d
trying discovery files to fix failures
syscordan Aug 28, 2025
ca39050
Merge branch 'test/syscordan_vertex_sc_tutorials' of https://github.c…
syscordan Aug 28, 2025
ae694d6
adding skip to test that has an issue
syscordan Sep 5, 2025
44dde47
Merge branch 'main' into test/syscordan_vertex_sc_tutorials
syscordan Sep 5, 2025
dfa8206
if using 252 the face id is different, this makes it pick the correct…
syscordan Sep 10, 2025
b6a02ef
Merge branch 'test/syscordan_vertex_sc_tutorials' of https://github.c…
syscordan Sep 10, 2025
4c62e5c
Merge branch 'main' into test/syscordan_vertex_sc_tutorials
RobPasMue Sep 11, 2025
58691d5
Merge branch 'main' into test/syscordan_vertex_sc_tutorials
syscordan Sep 12, 2025
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
1 change: 1 addition & 0 deletions doc/changelog.d/2157.test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adding test for vertex and tests based on spaceclaim tutorials
13 changes: 13 additions & 0 deletions tests/_incompatible_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ backends:
- tests/integration/test_repair_tools.py::test_design_import_check_geometry
- tests/integration/test_design.py::test_import_component_named_selections
- tests/integration/test_design.py::test_component_make_independent
- tests/integration/test_spaceclaim_tutorial_examples.py::test_combine_example
- tests/integration/test_spaceclaim_tutorial_examples.py::test_pull_example
- tests/integration/test_spaceclaim_tutorial_examples.py::test_intersect_example
# Opening large files through streaming is only available from 25.2 onwards
- tests/integration/test_design.py::test_modeler_open_files
# Named selections elements are only consistent from 25.2 onwards
Expand All @@ -65,6 +68,7 @@ backends:
# Components and vertex only available from 26.1 onwards
- tests/integration/test_design.py::test_named_selection_contents
- tests/integration/test_design.py::test_named_selections_components
- tests/integration/test_design.py::test_vertices
# Bounding box center is only available from 25R2 onwards
- tests/integration/test_design.py::test_get_body_bounding_box
# Export to DSCO files is only available from 25R2 onwards
Expand Down Expand Up @@ -159,6 +163,9 @@ backends:
- tests/integration/test_repair_tools.py::test_design_import_check_geometry
- tests/integration/test_design.py::test_import_component_named_selections
- tests/integration/test_design.py::test_component_make_independent
- tests/integration/test_spaceclaim_tutorial_examples.py::test_combine_example
- tests/integration/test_spaceclaim_tutorial_examples.py::test_pull_example
- tests/integration/test_spaceclaim_tutorial_examples.py::test_intersect_example
# Opening large files through streaming is only available from 25.2 onwards
- tests/integration/test_design.py::test_modeler_open_files
# Named selections elements are only consistent from 25.2 onwards
Expand All @@ -173,6 +180,7 @@ backends:
# Components and vertex only available from 26.1 onwards
- tests/integration/test_design.py::test_named_selection_contents
- tests/integration/test_design.py::test_named_selections_components
- tests/integration/test_design.py::test_vertices
# Bounding box center is only available from 25R2 onwards
- tests/integration/test_design.py::test_get_body_bounding_box
# Export to DSCO files is only available from 25R2 onwards
Expand Down Expand Up @@ -214,6 +222,9 @@ backends:
# Model used is too new for this version
- tests/integration/test_design.py::test_import_component_named_selections
- tests/integration/test_design.py::test_component_make_independent
- tests/integration/test_spaceclaim_tutorial_examples.py::test_combine_example
- tests/integration/test_spaceclaim_tutorial_examples.py::test_pull_example
- tests/integration/test_spaceclaim_tutorial_examples.py::test_intersect_example
# Opening large files through streaming is only available from 25.2 onwards
- tests/integration/test_design.py::test_modeler_open_files
# Named selections elements are only consistent from 25.2 onwards
Expand All @@ -228,6 +239,7 @@ backends:
# Components and vertex only available from 26.1 onwards
- tests/integration/test_design.py::test_named_selection_contents
- tests/integration/test_design.py::test_named_selections_components
- tests/integration/test_design.py::test_vertices
# Potential problem in model/reading design for importing parameters
- tests/integration/test_design.py::test_design_parameters
# Bounding box center is only available from 25R2 onwards
Expand Down Expand Up @@ -287,6 +299,7 @@ backends:
- tests/integration/test_design.py::test_named_selection_contents
- tests/integration/test_design.py::test_named_selections_components
- tests/integration/test_design.py::test_component_make_independent
- tests/integration/test_design.py::test_vertices
# Insert/Import file operations caused problems prior to 26.1
- tests/integration/test_design_export.py::test_import_export_reimport_design_scdocx
- tests/integration/test_design_export.py::test_import_export_reimport_design_x_t
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added tests/integration/files/Intersect.dsco
Binary file not shown.
122 changes: 122 additions & 0 deletions tests/integration/test_design.py
Original file line number Diff line number Diff line change
Expand Up @@ -3665,6 +3665,128 @@ def test_component_make_independent(modeler: Modeler):
assert not Accuracy.length_is_equal(comp.bodies[0].volume.m, face.body.volume.m)


def test_vertices(modeler: Modeler, tmp_path_factory: pytest.TempPathFactory):
design = modeler.open_file(Path(FILES_DIR, "DifferentShapes.scdocx"))

assert len(design.named_selections) == 4

edgevertex = design._named_selections["EdgeVertex"]
assert len(edgevertex.vertices) == 3

surfacevertex = design._named_selections["SurfaceVertex"]
assert len(surfacevertex.vertices) == 4

justedge = design._named_selections["JustEdge"]
assert len(justedge.vertices) == 0

spherefacevertex = design._named_selections["SphereFaceVertex"]
assert len(spherefacevertex.vertices) == 2

assert design.bodies[1].vertices[0].x.magnitude == pytest.approx(0.028, 1e-6, 1e-6)
assert design.bodies[1].vertices[0].y.magnitude == pytest.approx(-0.00288675, 1e-6, 1e-6)
assert design.bodies[1].vertices[0].z.magnitude == pytest.approx(0.01, 1e-6, 1e-6)

print(design.bodies[1].vertices[0].id == "S,~sEbf61ff70-bc08-477a-8a5e-a7c7dc955f40.853__")

assert design.bodies[0].vertices == []
assert design.bodies[1].vertices[1].position == pytest.approx(
Point3D([0.033, -0.0057735, 0.01]), 1e-6, 1e-6
)
assert design.bodies[1].vertices[2].position == pytest.approx(
Point3D([0.028, -0.00288675, 0.0]), 1e-6, 1e-6
)
assert design.bodies[1].vertices[3].position == pytest.approx(
Point3D([0.028, 0.00288675, 0.01]), 1e-6, 1e-6
)
assert design.bodies[1].vertices[4].position == pytest.approx(
Point3D([0.028, 0.00288675, 0.0]), 1e-6, 1e-6
)
assert design.bodies[1].vertices[5].position == pytest.approx(
Point3D([0.033, 0.0057735, 0.01]), 1e-6, 1e-6
)
assert design.bodies[1].vertices[6].position == pytest.approx(
Point3D([0.033, 0.0057735, 0.0]), 1e-6, 1e-6
)
assert design.bodies[1].vertices[7].position == pytest.approx(
Point3D([0.038, 0.00288675, 0.01]), 1e-6, 1e-6
)
assert design.bodies[1].vertices[8].position == pytest.approx(
Point3D([0.038, 0.00288675, 0.0]), 1e-6, 1e-6
)
assert design.bodies[1].vertices[9].position == pytest.approx(
Point3D([0.038, -0.00288675, 0.01]), 1e-6, 1e-6
)
assert design.bodies[1].vertices[10].position == pytest.approx(
Point3D([0.038, -0.00288675, 0.0]), 1e-6, 1e-6
)
assert design.bodies[1].vertices[11].position == pytest.approx(
Point3D([0.033, -0.0057735, 0.0]), 1e-6, 1e-6
)
assert design.bodies[2].vertices[0].position == pytest.approx(
Point3D([1.60966008e-02, -9.90374453e-04, 4.87404356e-19]), 1e-6, 1e-6
)
assert design.bodies[2].vertices[1].position == pytest.approx(
Point3D([0.00580814, 0.00425186, 0.02]), 1e-6, 1e-6
)
assert design.bodies[2].vertices[2].position == pytest.approx(
Point3D([0.00580814, 0.01579886, 0.0]), 1e-6, 1e-6
)
assert design.bodies[2].vertices[3].position == pytest.approx(
Point3D([5.80814371e-03, 4.25185629e-03, -7.12805714e-20]), 1e-6, 1e-6
)
assert design.bodies[3].vertices == []
assert design.bodies[4].vertices[0].position == pytest.approx(
Point3D([-0.03, 0.001, 0.0]), 1e-6, 1e-6
)
assert design.bodies[4].vertices[1].position == pytest.approx(
Point3D([-0.03, 0.02, 0.0]), 1e-6, 1e-6
)
assert design.bodies[4].vertices[2].position == pytest.approx(
Point3D([-0.011, 0.001, 0.0]), 1e-6, 1e-6
)
assert design.bodies[4].vertices[3].position == pytest.approx(
Point3D([-0.011, 0.02, 0.0]), 1e-6, 1e-6
)
assert design.bodies[5].vertices == []
assert design.components[0].bodies[0].vertices[0].position == pytest.approx(
Point3D([0.00711, 0.03182325, 0.0]), 1e-6, 1e-6
)
assert design.components[0].bodies[0].vertices[1].position == pytest.approx(
Point3D([0.00711, 0.03759675, 0]), 1e-6, 1e-6
)
assert design.components[0].bodies[0].vertices[2].position == pytest.approx(
Point3D([0.00211, 0.0404835, 0]), 1e-6, 1e-6
)
assert design.components[0].bodies[0].vertices[3].position == pytest.approx(
Point3D([-0.00289, 0.03759675, 0]), 1e-6, 1e-6
)
assert design.components[0].bodies[0].vertices[4].position == pytest.approx(
Point3D([-0.00289, 0.03182325, 0]), 1e-6, 1e-6
)
assert design.components[0].bodies[0].vertices[5].position == pytest.approx(
Point3D([0.00211, 0.0289365, 0]), 1e-6, 1e-6
)

vert = [design.bodies[1].vertices[0], design.bodies[2].vertices[3]]
edg = [design.bodies[1].edges[0], design.bodies[2].edges[0]]
fac = [design.bodies[1].faces[0], design.bodies[2].faces[1]]
design.create_named_selection("Test", vertices=vert, edges=edg, faces=fac)
assert len(design.named_selections) == 5

testns = design._named_selections["Test"]
assert len(testns.vertices) == 2

location = tmp_path_factory.mktemp("test_export_to_scdocx")
file_location = location / f"{design.name}.scdocx"
design.export_to_scdocx(location)
assert file_location.exists()
design_read = modeler.open_file(file_location)
assert len(design_read.named_selections) == 5

exportedtestns = design_read._named_selections["Test"]
assert len(exportedtestns.vertices) == 2


@pytest.mark.parametrize(
"file_extension, design_format",
[
Expand Down
Loading