Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Now returning the number of volumes in the cad when calling a cad adding method #84

Merged
merged 3 commits into from
Apr 18, 2024

Conversation

shimwell
Copy link
Member

@shimwell shimwell commented Apr 17, 2024

this just returns the number of volumes in the cad object/stp file when they are added

this provides a way of users finding out how many material tags to add

tests have been added to the CI

@shimwell
Copy link
Member Author

shimwell commented Apr 17, 2024

possible test idea

def test_add_cadquery_object_returned_volumes():
    """Checks that a add_cadquery_object method returns the correct number of volumes"""

    sphere1 = cq.Workplane().sphere(20)
    sphere2 = cq.Workplane().moveTo(100, 100).sphere(20)
    sphere3 = cq.Workplane().moveTo(-100, -100).sphere(20)

    c2d = CadToDagmc()
    vols = c2d.add_cadquery_object(sphere1)
    assert vols == 1

    assembly = cq.Assembly()
    assembly.add(sphere1)
    assembly.add(sphere2)
    assembly.add(sphere3)
    c2d = CadToDagmc()
    vols = c2d.add_cadquery_object(assembly)
    assert vols == 3

@shimwell shimwell merged commit ee9e717 into main Apr 18, 2024
5 of 6 checks passed
@shimwell shimwell deleted the adding_return_of_material_tags branch April 18, 2024 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant