We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
cadquery.Assemby objects get returned by the functions and these include the plasma
Some use cases don't require the plasma (e.g. meshing for neutronics model) so it would be useful to be able to remove parts from the reactor
In the longer term cadquery assembies might have a .remove method but for now we can make a new assembly and filter by part name
.remove
This example makes an assembly with a box and sphere, then makes a new assembly without the box
import warnings class Assembly(cq.Assembly): def remove(self, name:str): new_assembly = Assembly() part_found=False for part in self: if part[1].endswith(f'/{name}'): part_found = True print('removing' , part) else: print('adding' , part) new_assembly.add(part[0], name=part[1], color=part[3], loc=part[2]) if part_found == False: warnings.warn(f'Part with name {name} not found') print() return new_assembly sphere1 = cq.Workplane().moveTo(2, 2).sphere(1) box1 = cq.Workplane().box(1, 1, 1) assembly = Assembly() assembly.add(box1, name="box1", color=cq.Color(0.5, 0.5, 0.5)) assembly.add(sphere1, name="sphere") assembly2 = assembly.remove('sphere') assembly3 = assembly.remove('box1') assembly4 = assembly.remove('bosdfsdf')
Alternatively we could add an argument include_plasma which would avoid monkey patching the class.
include_plasma
The text was updated successfully, but these errors were encountered:
No branches or pull requests
cadquery.Assemby objects get returned by the functions and these include the plasma
Some use cases don't require the plasma (e.g. meshing for neutronics model) so it would be useful to be able to remove parts from the reactor
In the longer term cadquery assembies might have a
.remove
method but for now we can make a new assembly and filter by part nameThis example makes an assembly with a box and sphere, then makes a new assembly without the box
Alternatively we could add an argument
include_plasma
which would avoid monkey patching the class.The text was updated successfully, but these errors were encountered: