cart3d Package¶
cart3d
Module¶
- Defines:
- Cart3D(log=None, debug=False)
read_cart3d(self, infilename, result_names=None)
write_cart3d(self, outfilename, is_binary=False, float_fmt=’%6.7f’)
flip_model()
make_mirror_model(self, nodes, elements, regions, loads, axis=’y’, tol=0.000001)
make_half_model(self, axis=’y’, remap_nodes=True)
get_free_edges(self, elements)
get_area(self)
get_normals(self)
get_normals_at_nodes(self, cnormals)
- comp2tri(in_filenames, out_filename,
is_binary=False, float_fmt=’%6.7f’)
-
class
pyNastran.converters.cart3d.cart3d.
Cart3D
(log=None, debug=False)[source]¶ Bases:
pyNastran.converters.cart3d.cart3d.Cart3dIO
Cart3d interface class
-
get_free_edges
(elements)[source]¶ Cart3d must be a closed model with each edge shared by 2 elements The free edges indicate the problematic areas.
- Returns
- free edges(nedges, 2) int ndarray
the free edge node ids
-
get_normals
()[source]¶ Gets the centroidal normals
- Returns
- cnormals(n, 3) ndarray
normalized centroidal normal vectors
-
get_normals_at_nodes
(cnormals)[source]¶ Gets the nodal normals
- Parameters
- cnormals(n, 3) ndarray
normalized centroidal normal vectors
- Returns
- nnormals(n, 3) ndarray
normalized nodal normal vectors
-
is_outward_normals
= True¶
-
is_structured
= False¶
-
make_half_model
(axis='y', remap_nodes=True)[source]¶ Makes a half model from a full model
Notes
Cp is really loads[‘Cp’] and was meant for loads analysis only
-
make_mirror_model
(nodes, elements, regions, loads, axis='y', tol=1e-06)[source]¶ Makes a full cart3d model about the given axis.
- Parameters
- nodes(nnodes, 3) ndarray
the nodes
- elements(nelements, 3) ndarray
the elmements
- regions(nelements) ndarray
the regions
- loadsdict[str] = (nnodes) ndarray
not supported
- axisstr; {“x”, “y”, “z”, “-x”, “-y”, “-z”}
a string of the axis
- tolfloat; default=0.000001
the tolerance for the centerline points
-
model_type
= 'cart3d'¶
-
-
class
pyNastran.converters.cart3d.cart3d.
Cart3dIO
(log=None, debug=False)[source]¶ Bases:
object
Cart3d IO class
-
property
nelements
¶ get the number of elements
-
property
nnodes
¶ alternate way to access number of points
-
property
nodes
¶ alternate way to access the points
-
property
npoints
¶ get the number of points
-
property
nresults
¶ get the number of results
-
property
-
pyNastran.converters.cart3d.cart3d.
comp2tri
(in_filenames, out_filename, is_binary=False, float_fmt='%6.7f', log=None, debug=False)[source]¶ Combines multiple Cart3d files (binary or ascii) into a single file.
- Parameters
- in_filenamesList[str]
list of filenames
- out_filenamestr
output filename
- is_binarybool; default=False
is the output file binary
- float_fmtstr; default=’%6.7f’
the format string to use for ascii writing
Notes
assumes loads is None
cart3d_result
Module¶
- defines:
Cart3dGeometry
cart3d_to_nastran
Module¶
-
pyNastran.converters.cart3d.cart3d_to_nastran.
cart3d_to_nastran_filename
(cart3d_filename, bdf_filename, log=None, debug=False)[source]¶ Converts a Cart3D file to Nastran format.
- Parameters
- cart3d_filenamestr
path to the input Cart3D file
- bdf_filenamestr
path to the output BDF file
- loglog / None
log : a logger object None : a log will be defined
- debugbool
True/False (used if log is not defined)
Examples
>>> cart3d_filename = 'threePlugs.tri' >>> bdf_filename = 'threePlugs.bdf' >>> cart3d_to_nastran_filename(cart3d_filename, bdf_filename)
-
pyNastran.converters.cart3d.cart3d_to_nastran.
cart3d_to_nastran_model
(cart3d_filename, log=None, debug=False)[source]¶ Converts a Cart3D file to Nastran format and returns a BDF() object.
- Parameters
- cart3d_filenamestr
path to the input Cart3D file
- loglog / None
log : a logger object None : a log will be defined
- debugbool
True/False (used if log is not defined)
- Returns
- bdf_modelBDF
BDF() model object
cart3d_to_stl
Module¶
- defines:
stl = cart3d_to_stl(cart3d, stl_filename=None, is_binary=False, log=None, debug=False)
stl = cart3d_to_stl_filename(cart3d_filename, stl_filename=None, is_binary=False, log=None, debug=False)
-
pyNastran.converters.cart3d.cart3d_to_stl.
cart3d_to_stl
(cart3d, stl_filename=None, is_binary=False, log=None, debug=False)[source]¶ Converts a Cart3D object to STL format.
- Parameters
- cart3dCart3D()
a Cart3D object
- stl_filenamestr; default=None
path to the output STL file (or None to skip)
- loglog
a logger object (or None)
- debugbool; default=False
True/False (used if log is not defined)
- Returns
- stlSTL()
an STL object
Todo
this seems to be broken… ..
-
pyNastran.converters.cart3d.cart3d_to_stl.
cart3d_to_stl_filename
(cart3d_filename, stl_filename=None, is_binary=False, log=None, debug=False)[source]¶ Converts a Cart3D file to STL format.
- Parameters
- cart3d_filenamestr
path to the input Cart3D file
- stl_filenamestr; default=None
path to the output STL file (or None to skip
- is_binarybool; default=False
writes the stl in binary
- loglog
a logger object (or None)
- debugbool; default=False
True/False (used if log is not defined)
- Returns
- stlSTL()
an STL object