载入中...
搜索中...
未找到
GeometryStroke.cpp
浏览该文件的文档.
18V3 cross(V3 a, V3 b) { return {a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x}; }
25void emitTriangle(MeshBuild& mesh, V3 a, V3 b, V3 c, float u0 = 0.f, float u1 = 1.f, float u2 = 1.f) {
82 DiagnosticCode::InvalidArgument, "geometry stroke minimum spacing must be finite and non-negative",
111 return Result<void>::failure(Diagnostic::error(DiagnosticCode::NotFound, "geometry stroke has no point to undo",
138 V3 forward{nextPoint.x - previousPoint.x, nextPoint.y - previousPoint.y, nextPoint.z - previousPoint.z};
148 rings.push_back({center - side * halfWidth - up * halfDepth, center + side * halfWidth - up * halfDepth,
151 rings.push_back({center - side * halfWidth - up * halfDepth, center + side * halfWidth - up * halfDepth,
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
Result< MeshBuild > buildMeshResult() const
Build an owning triangle mesh without mutating the stroke.
Definition GeometryStroke.cpp:124
Result< void > undoResult()
Remove the most recently accepted point.
Definition GeometryStroke.cpp:109
Result< void > setMinimumSpacingResult(float spacing)
Set the non-negative minimum accepted distance between input points.
Definition GeometryStroke.cpp:79
Result< bool > addPointResult(float x, float y, float z)
Append a finite point; returns false when minimum spacing rejects it.
Definition GeometryStroke.cpp:89
std::string_view shape() const noexcept
Return the selected cross-section name.
Definition GeometryStroke.h:48
Result< void > setInputSpaceResult(std::string_view inputSpace, float planeY=0.f)
Select spatial input or planar input constrained to planeY.
Definition GeometryStroke.cpp:51
Result< void > setSizeResult(float width, float depth)
Set positive stroke width and depth.
Definition GeometryStroke.cpp:68
std::string_view inputSpace() const noexcept
Return the selected input-space name.
Definition GeometryStroke.h:50
Result< void > setShapeResult(std::string_view shape)
Select quad, triangularPrism, or cube cross-section generation.
Definition GeometryStroke.cpp:41
CPU triangle mesh from procedural mesh recipes (e.g. marching cubes). Positions/normals are xyz-packe...
Definition MeshBuild.h:19
int setActiveGroup(const std::string &name)
Select/create the named group assigned to subsequently added triangles.
Definition MeshBuild.cpp:53
Definition EvpackPointGraphLoader.h:12
@ InvalidArgument
@ NotFound
One input sample owned by a procedural geometry stroke.
Definition GeometryStroke.h:13