-
Notifications
You must be signed in to change notification settings - Fork 12
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
Create Facets From Point Cloud, and Volumes From Facets With Cubit #177
base: main
Are you sure you want to change the base?
Conversation
This looks promising - I wonder if we can do this easier/better/faster directly wit pymoab/MOAB? i.e. without Cubit |
parastell/invessel_build.py
Outdated
# remove overlap | ||
print("removing overlap") | ||
layers = list(self.radial_build.radial_build.values()) | ||
for layer, next_layer in zip( | ||
reversed(layers[0:-1]), reversed(layers[1:]) | ||
): | ||
cubit.cmd( | ||
"remove overlap volume " | ||
f"{layer['vol_id']} {next_layer['vol_id']} modify larger" | ||
) | ||
cubit.cmd('save cub5 "overlap_removed.cub5" overwrite') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What overlap is occurring?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
each volume is made without the through hole, similar to how they are made in CADquery now. This subtracts the inner component from the outer component, working outside in.
parastell/invessel_build.py
Outdated
cubit.cmd( | ||
f"imprint volume {layer['vol_id']} {next_layer['vol_id']}" | ||
) | ||
cubit.cmd(f"merge volume {layer['vol_id']} {next_layer['vol_id']}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably make this the way we imprint and merge by default in Stellarator.export_dagmc
Also, in response to @gonuke's comment, it should be possible to do this in MOAB instead, since we're not really performing any CAD operations (except maybe removing overlaps) |
I don't know much about pymoab/MOAB, but I'm sure it would be possible. This has the benefit of using tools I already knew and existing code in parastell, plus we still can get CAD solids out of Cubit, so even in the event that we implement a MOAB workflow, it might be nice to retain this. A MOAB workflow would be faster/more scaleable but would need a lot of additional development work. |
I can also confirm that this alleviates the issues in the geometries @FusionSandwich and I were having issues in with the splines causing self-intersecting volumes. |
Still work in progress, but this is functioning. Uses the point cloud data from surface objects to create facets. These facets are then connected into a surface, and the ends are closed off, forming a volume. Working from outside in, the overlap from volumes is removed, and then adjacent volumes are imprinted and merged. Volume ids are stored in the radial build during building so existing dagmc export functions work no problem. As can be seen from the diff here, this isn't particularly complicated, and it will be nice to have options when the splines are acting up, even if there are perhaps better ways long term to make this faceted representation.
Here's the geometry using the inputs from the parastell example, built using this workflow.