fusionsc.geometry.Geometry
- class fusionsc.geometry.Geometry(val=None, msgSize=1024, byReference=False)
Methods
|
Creates a new instance by either: - Allocating a new message of size msgSize (if val is None) - Storing a reference to the target (if byReference is set) - Copying the message from the given target (accepts Cap'n'proto messages, YAML strings, lists, dicts, and NumPy arrays) |
|
Exports as a single merged polygon mesh Note Has asynchronous variant '.asnc(...)' that returns Promise[...] |
|
Convert the given geometry into a PyVista / VTK mesh Note Has asynchronous variant '.asnc(...)' that returns Promise[...] |
|
Note Has asynchronous variant '.asnc(...)' that returns Promise[...] |
|
For a geometry of 'ref' type, downloads the contents of the referenced geometry and wraps them in a new Geometry instance Note Has asynchronous variant '.asnc(...)' that returns Promise[...] |
|
Saves the geometry to the given filename. |
|
Restricts the geometry to meshes where the given tags meet one (or more) specified values |
|
Creates a geometry out of a 2D RZ array by wrapping it toroidally |
|
Creates a geometry from a pyvista.PolyData object |
After merging the geometry, downloads the merged data and returns them Note Has asynchronous variant '.asnc(...)' that returns Promise[...] |
|
|
Note Has asynchronous variant '.asnc(...)' that returns Promise[...] |
|
Visualizes the contents in a graph structure. |
|
Creates a geometry from a file (non-PLY loaded using meshio) |
|
Computes an indexed geometry for accelerated intersection tests Note Has asynchronous variant '.asnc(...)' that returns Promise[...] |
|
Computes a line intersection test Note Has asynchronous variant '.asnc(...)' that returns Promise[...] |
|
Loads an instance of this class from a previously written archive file. |
|
Creates a merged geometry (all meshes combined into one big message) Note Has asynchronous variant '.asnc(...)' that returns Promise[...] |
|
Computed a new geometry obtained by clipping the target geometry along the given plane (half space intersection) Note Has asynchronous variant '.asnc(...)' that returns Promise[...] |
|
Computes a planar cut of the geometry along either a given plane or a given phi plane Note Has asynchronous variant '.asnc(...)' that returns Promise[...] |
|
Plot the phi cut of a given geometry in either the given axes or the current active matplotlib axes Note Has asynchronous variant '.asnc(...)' that returns Promise[...] |
|
Creates a polygon mesh from a [N, 3] array-like of vertices and a list of polygins (which is each a list of vertex indices) |
|
Prints a tree version of this object. |
|
Creates a geometry out of a quad mesh |
|
Creates a new geometry with small meshes combined into a small number of large meshes Note Has asynchronous variant '.asnc(...)' that returns Promise[...] |
|
Returns a new geometry with all unresolved nodes replaced by their resolved equivalents. |
|
Returns a new geometry rotated around the prescribed axis and center point |
|
Saves the object into an archive file (including all referenced data) |
|
Returns a geometry scaled by the given factor |
|
Prints the contents as block-structured YAML |
|
Returns a new geometry shifted by the given vector |
|
Note Has asynchronous variant '.asnc(...)' that returns Promise[...] |
|
Note Has asynchronous variant '.asnc(...)' that returns Promise[...] |
|
Note Has asynchronous variant '.asnc(...)' that returns Promise[...] |
|
Converts the geometry into a point cloud Note Has asynchronous variant '.asnc(...)' that returns Promise[...] |
|
Returns a new geometry with the given tags |
Attributes
|
Underlying Cap'n'proto struct (usually a builder type). |
|
Methods
- Geometry.__init__(val=None, msgSize=1024, byReference=False)
Creates a new instance by either: - Allocating a new message of size msgSize (if val is None) - Storing a reference to the target (if byReference is set) - Copying the message from the given target (accepts Cap’n’proto messages,
YAML strings, lists, dicts, and NumPy arrays)
- Geometry.asPolyMesh(triangulate: bool = False) Any
Exports as a single merged polygon mesh Note Has asynchronous variant ‘.asnc(…)’ that returns Promise[…]
- Geometry.asPyvista(reduce: bool = True) Any
Convert the given geometry into a PyVista / VTK mesh Note Has asynchronous variant ‘.asnc(…)’ that returns Promise[…]
- Geometry.cache(filename) Any
Note Has asynchronous variant ‘.asnc(…)’ that returns Promise[…]
- Geometry.download() Any
For a geometry of ‘ref’ type, downloads the contents of the referenced geometry and wraps them in a new Geometry instance Note Has asynchronous variant ‘.asnc(…)’ that returns Promise[…]
- Geometry.exportTo(filename: str, binary=True, triangulate=True) Any
Saves the geometry to the given filename. Supports ‘.ply’, ‘.stl’, and ‘.vtk’ files. Note Has asynchronous variant ‘.asnc(…)’ that returns Promise[…]
- Geometry.filter(filter)
Restricts the geometry to meshes where the given tags meet one (or more) specified values
- static Geometry.from2D(r, z, nPhi=100, phi1=None, phi2=None, close=True, tags={})
Creates a geometry out of a 2D RZ array by wrapping it toroidally
- static Geometry.fromPyvista(polyData)
Creates a geometry from a pyvista.PolyData object
- Geometry.getMerged() Any
After merging the geometry, downloads the merged data and returns them Note Has asynchronous variant ‘.asnc(…)’ that returns Promise[…]
- Geometry.getTags() Any
Note Has asynchronous variant ‘.asnc(…)’ that returns Promise[…]
- Geometry.graph(**kwargs)
Visualizes the contents in a graph structure. Requires graphviz
- static Geometry.importFrom(filename: str)
Creates a geometry from a file (non-PLY loaded using meshio)
- Geometry.index(geometryGrid) Any
Computes an indexed geometry for accelerated intersection tests Note Has asynchronous variant ‘.asnc(…)’ that returns Promise[…]
- Geometry.intersect(pStart, pEnd, grid=None) Any
Computes a line intersection test Note Has asynchronous variant ‘.asnc(…)’ that returns Promise[…]
- Geometry.load() Any
Loads an instance of this class from a previously written archive file.
Note Has asynchronous variant ‘.asnc(…)’ that returns Promise[…]
- Geometry.merge() Any
Creates a merged geometry (all meshes combined into one big message) Note Has asynchronous variant ‘.asnc(…)’ that returns Promise[…]
- Geometry.planarClip(phi=None, normal=None, center=None) Any
Computed a new geometry obtained by clipping the target geometry along the given plane (half space intersection) Note Has asynchronous variant ‘.asnc(…)’ that returns Promise[…]
- Geometry.planarCut(phi=None, normal=None, center=None) Any
Computes a planar cut of the geometry along either a given plane or a given phi plane Note Has asynchronous variant ‘.asnc(…)’ that returns Promise[…]
- Geometry.plotCut(phi=0, ax=None, plot=True, **kwArgs) Any
Plot the phi cut of a given geometry in either the given axes or the current active matplotlib axes Note Has asynchronous variant ‘.asnc(…)’ that returns Promise[…]
- static Geometry.polyMesh(vertices, polyIndices)
Creates a polygon mesh from a [N, 3] array-like of vertices and a list of polygins (which is each a list of vertex indices)
- Geometry.ptree()
Prints a tree version of this object. Requires the printree library.
- static Geometry.quadMesh(vertices, wrapU=False, wrapV=False)
Creates a geometry out of a quad mesh
- params:
vertices: A numpy array-like of shape [3, nU, nV] containing the individual vertices
wrapU: Whether to link the first and last slice of the “u” dimension
wrapV: Whether to link the first and last slice of the “v” dimension
- Geometry.reduce(maxVerts=1000000, maxIndices=1000000) Any
Creates a new geometry with small meshes combined into a small number of large meshes Note Has asynchronous variant ‘.asnc(…)’ that returns Promise[…]
- Geometry.resolve() Any
Returns a new geometry with all unresolved nodes replaced by their resolved equivalents. Note Has asynchronous variant ‘.asnc(…)’ that returns Promise[…]
- Geometry.rotate(angle, axis, center=[0, 0, 0])
Returns a new geometry rotated around the prescribed axis and center point
- Geometry.save(filename) Any
Saves the object into an archive file (including all referenced data)
Note Has asynchronous variant ‘.asnc(…)’ that returns Promise[…]
- Geometry.scale(by=1.0)
Returns a geometry scaled by the given factor
- Geometry.toYaml(flow=False)
Prints the contents as block-structured YAML
- Geometry.translate(dx)
Returns a new geometry shifted by the given vector
- Geometry.triangulate(maxEdgeLength: float = 0) Any
Note Has asynchronous variant ‘.asnc(…)’ that returns Promise[…]
- Geometry.unroll(phi1: float, phi2: float, clip: bool = True) Any
Note Has asynchronous variant ‘.asnc(…)’ that returns Promise[…]
- Geometry.upload() Any
Note Has asynchronous variant ‘.asnc(…)’ that returns Promise[…]
- Geometry.weightedSample(scale: float) Any
Converts the geometry into a point cloud Note Has asynchronous variant ‘.asnc(…)’ that returns Promise[…]
- Geometry.withTags(extraTags)
Returns a new geometry with the given tags