The conversions.py
module#
Summary#
Convert a |
|
Convert a |
|
Convert a |
|
Convert lists of |
|
Convert a list of |
|
Convert an |
|
Convert a |
|
Convert a |
|
Convert a |
|
Convert a |
|
Convert a |
|
Convert a |
|
Convert an |
|
Convert an |
|
Convert a frame gRPC message to a |
|
Convert a surface gRPC message to a |
|
Convert a curve gRPC message to a |
|
Convert a |
|
Convert a |
|
Convert a |
|
Convert a |
Description#
Module providing for conversions.
Module detail#
- conversions.unit_vector_to_grpc_direction(unit_vector: ansys.geometry.core.math.vector.UnitVector3D) ansys.api.geometry.v0.models_pb2.Direction #
Convert a
UnitVector3D
class to a unit vector gRPC message.- Parameters:
- unit_vector
UnitVector3D
Source vector data.
- unit_vector
- Returns:
GRPCDirection
Geometry service gRPC direction message.
- conversions.frame_to_grpc_frame(frame: ansys.geometry.core.math.frame.Frame) ansys.api.geometry.v0.models_pb2.Frame #
Convert a
Frame
class to a frame gRPC message.- Parameters:
- frame
Frame
Source frame data.
- frame
- Returns:
GRPCFrame
Geometry service gRPC frame message. The unit for the frame origin is meters.
- conversions.plane_to_grpc_plane(plane: ansys.geometry.core.math.plane.Plane) ansys.api.geometry.v0.models_pb2.Plane #
Convert a
Plane
class to a plane gRPC message.- Parameters:
- plane
Plane
Source plane data.
- plane
- Returns:
GRPCPlane
Geometry service gRPC plane message. The unit is meters.
- conversions.sketch_shapes_to_grpc_geometries(plane: ansys.geometry.core.math.plane.Plane, edges: list[ansys.geometry.core.sketch.edge.SketchEdge], faces: list[ansys.geometry.core.sketch.face.SketchFace], only_one_curve: bool = False) ansys.api.geometry.v0.models_pb2.Geometries #
Convert lists of
SketchEdge
andSketchFace
to a gRPC message.- Parameters:
- Returns:
GRPCGeometries
Geometry service gRPC geometries message. The unit is meters.
- conversions.sketch_edges_to_grpc_geometries(edges: list[ansys.geometry.core.sketch.edge.SketchEdge], plane: ansys.geometry.core.math.plane.Plane) tuple[list[ansys.api.geometry.v0.models_pb2.Line], list[ansys.api.geometry.v0.models_pb2.Arc]] #
Convert a list of
SketchEdge
to a gRPC message.
- conversions.sketch_arc_to_grpc_arc(arc: ansys.geometry.core.sketch.arc.Arc, plane: ansys.geometry.core.math.plane.Plane) ansys.api.geometry.v0.models_pb2.Arc #
Convert an
Arc
class to an arc gRPC message.- Parameters:
- arc
Arc
Source arc data.
- plane
Plane
Plane for positioning the arc within.
- arc
- Returns:
GRPCArc
Geometry service gRPC arc message. The unit is meters.
- conversions.sketch_ellipse_to_grpc_ellipse(ellipse: ansys.geometry.core.sketch.ellipse.SketchEllipse, plane: ansys.geometry.core.math.plane.Plane) ansys.api.geometry.v0.models_pb2.Ellipse #
Convert a
SketchEllipse
class to an ellipse gRPC message.- Parameters:
- ellipse
SketchEllipse
Source ellipse data.
- ellipse
- Returns:
GRPCEllipse
Geometry service gRPC ellipse message. The unit is meters.
- conversions.sketch_circle_to_grpc_circle(circle: ansys.geometry.core.sketch.circle.SketchCircle, plane: ansys.geometry.core.math.plane.Plane) ansys.api.geometry.v0.models_pb2.Circle #
Convert a
SketchCircle
class to a circle gRPC message.- Parameters:
- circle
SketchCircle
Source circle data.
- plane
Plane
Plane for positioning the circle.
- circle
- Returns:
GRPCCircle
Geometry service gRPC circle message. The unit is meters.
- conversions.point3d_to_grpc_point(point: ansys.geometry.core.math.point.Point3D) ansys.api.geometry.v0.models_pb2.Point #
Convert a
Point3D
class to a point gRPC message.- Parameters:
- point
Point3D
Source point data.
- point
- Returns:
GRPCPoint
Geometry service gRPC point message. The unit is meters.
- conversions.point2d_to_grpc_point(plane: ansys.geometry.core.math.plane.Plane, point2d: ansys.geometry.core.math.point.Point2D) ansys.api.geometry.v0.models_pb2.Point #
Convert a
Point2D
class to a point gRPC message.- Parameters:
- plane
Plane
Plane for positioning the 2D point.
- point
Point2D
Source point data.
- plane
- Returns:
GRPCPoint
Geometry service gRPC point message. The unit is meters.
- conversions.sketch_polygon_to_grpc_polygon(polygon: ansys.geometry.core.sketch.polygon.Polygon, plane: ansys.geometry.core.math.plane.Plane) ansys.api.geometry.v0.models_pb2.Polygon #
Convert a
Polygon
class to a polygon gRPC message.- Parameters:
- polygon
Polygon
Source polygon data.
- polygon
- Returns:
GRPCPolygon
Geometry service gRPC polygon message. The unit is meters.
- conversions.sketch_segment_to_grpc_line(segment: ansys.geometry.core.sketch.segment.SketchSegment, plane: ansys.geometry.core.math.plane.Plane) ansys.api.geometry.v0.models_pb2.Line #
Convert a
Segment
class to a line gRPC message.- Parameters:
- segment
SketchSegment
Source segment data.
- segment
- Returns:
GRPCLine
Geometry service gRPC line message. The unit is meters.
- conversions.tess_to_pd(tess: ansys.api.geometry.v0.models_pb2.Tessellation) pyvista.PolyData #
Convert an
ansys.api.geometry.Tessellation
topyvista.PolyData
.
- conversions.grpc_matrix_to_matrix(m: ansys.api.geometry.v0.models_pb2.Matrix) ansys.geometry.core.math.matrix.Matrix44 #
Convert an
ansys.api.geometry.Matrix
to aMatrix44
.
- conversions.grpc_frame_to_frame(frame: ansys.api.geometry.v0.models_pb2.Frame) ansys.geometry.core.math.frame.Frame #
Convert a frame gRPC message to a
Frame
class.- Parameters:
- GRPCFrame
Geometry service gRPC frame message. The unit for the frame origin is meters.
- Returns:
- frame
Frame
Resulting converted frame.
- frame
- conversions.grpc_surface_to_surface(surface: ansys.api.geometry.v0.models_pb2.Surface, surface_type: ansys.geometry.core.designer.face.SurfaceType) ansys.geometry.core.shapes.surfaces.surface.Surface #
Convert a surface gRPC message to a
Surface
class.- Parameters:
- surface
GRPCSurface
Geometry service gRPC surface message.
- surface
- Returns:
Surface
Resulting converted surface.
- conversions.grpc_curve_to_curve(curve: ansys.api.geometry.v0.models_pb2.CurveGeometry) ansys.geometry.core.shapes.curves.curve.Curve #
Convert a curve gRPC message to a
Curve
.- Parameters:
- curve
GRPCCurve
Geometry service gRPC curve message.
- curve
- Returns:
Curve
Resulting converted curve.
- conversions.curve_to_grpc_curve(curve: ansys.geometry.core.shapes.curves.curve.Curve) ansys.api.geometry.v0.models_pb2.CurveGeometry #
Convert a
Curve
object to a curve gRPC message.- Parameters:
- curve
Curve
Curve to convert.
- curve
- Returns:
GRPCCurve
Return
Curve
as aansys.api.geometry.CurveGeometry
message.
- conversions.trimmed_curve_to_grpc_trimmed_curve(curve: ansys.geometry.core.shapes.curves.trimmed_curve.TrimmedCurve) ansys.api.geometry.v0.models_pb2.TrimmedCurve #
Convert a
TrimmedCurve
to a trimmed curve gRPC message.- Parameters:
- curve
TrimmedCurve
Curve to convert.
- curve
- Returns:
GRPCTrimmedCurve
Geometry service gRPC
TrimmedCurve
message.
- conversions.surface_to_grpc_surface(surface: ansys.geometry.core.shapes.surfaces.surface.Surface) tuple[ansys.api.geometry.v0.models_pb2.Surface, ansys.api.geometry.v0.models_pb2.SurfaceType] #
Convert a
Surface
object to a surface gRPC message.- Parameters:
- surface
Surface
Surface to convert.
- surface
- Returns:
GRPCSurface
Return
Surface
as aansys.api.geometry.Surface
message.GRPCSurfaceType
Return the grpc surface type of
Surface
.
- conversions.trimmed_surface_to_grpc_trimmed_surface(trimmed_surface: ansys.geometry.core.shapes.surfaces.TrimmedSurface) ansys.api.geometry.v0.models_pb2.TrimmedSurface #
Convert a
TrimmedSurface
to a trimmed surface gRPC message.- Parameters:
- trimmed_surface
TrimmedSurface
Surface to convert.
- trimmed_surface
- Returns:
GRPCTrimmedSurface
Geometry service gRPC
TrimmedSurface
message.