rf::Indexalias<ridgeforge/types.hpp>since 0.1.0using Index = std::uint32_t;
Vertex and triangle index type. Caps a mesh at 2^31-1 vertices.
reference index
The API narrative reads top to bottom and explains why things are shaped the way they are. This page is the flat index: filter 37 symbols by name, kind or area, copy a signature, jump straight to one. The same records are served as symbols.json, so an editor plugin can read them without scraping HTML.
No symbol matches that filter.
rf::Indexalias<ridgeforge/types.hpp>since 0.1.0using Index = std::uint32_t;
Vertex and triangle index type. Caps a mesh at 2^31-1 vertices.
rf::Scalaralias<ridgeforge/types.hpp>since 0.1.0using Scalar = float;
Floating scalar; becomes double under -DRF_DOUBLE_PRECISION=ON.
rf::Vec3struct<ridgeforge/types.hpp>since 0.1.0struct Vec3 { Scalar x, y, z; };
Three-component position or direction.
rf::Vec2struct<ridgeforge/types.hpp>since 0.4.0struct Vec2 { Scalar u, v; };
Texture coordinate pair.
rf::Tristruct<ridgeforge/types.hpp>since 0.1.0struct Tri { Index v[3]; };
One triangle as three vertex indices.
rf::AABBstruct<ridgeforge/types.hpp>since 0.3.0struct AABB { Vec3 lo, hi; bool empty() const; Vec3 extent() const; };
Axis-aligned bounding box; empty() is true before any point is added.
rf::Statusenum<ridgeforge/types.hpp>since 0.2.0enum class Status { Ok, FileNotFound, ParseError, UnsupportedFormat, EmptyMesh, NonManifold, InvalidOption, OutOfRange, Cancelled, WriteFailed };
Ten outcomes; only Ok means success. Carried by every Result.
rf::Result<T>class<ridgeforge/types.hpp>since 0.2.0template<class T> class Result { explicit operator bool() const noexcept; Status status() const noexcept; const char* message() const noexcept; T& value(); T& operator*(); };
Error channel used instead of exceptions. Falsy unless status()==Status::Ok.
rf::Meshclass<ridgeforge/mesh.hpp>since 0.4.0class Mesh { std::vector<Vec3> positions; std::vector<Tri> triangles; std::vector<Vec3> normals; std::vector<Vec2> uv; ... };
Indexed triangle mesh as a plain struct with helper methods; fill the vectors directly if needed.
members: vertex_count(), triangle_count(), has_normals(), has_uv(), bounds(), clear(), reserve(), validate()
rf::Mesh::boundsmethod<ridgeforge/mesh.hpp>since 0.4.0AABB bounds() const noexcept;
Recomputed in linear time each call; returns an empty box for an empty mesh, never inverted.
rf::Mesh::validatemethod<ridgeforge/mesh.hpp>since 0.4.0Result<void> validate() const;
Checks index ranges, non-finite coordinates and attribute sizes. Linear, allocation-free. Call once after building by hand.
returns Ok, or OutOfRange / InvalidOption describing the first problem.
rf::MeshViewclass<ridgeforge/mesh.hpp>since 0.5.0MeshView(const Vec3* pos, std::size_t nverts, const Tri* tris, std::size_t ntris) noexcept; MeshView(const Mesh&) noexcept;
Non-owning read-only view for algorithms that never mutate. Accepted by Stats::of and SelfIntersection::find.
rf::Statsstruct<ridgeforge/stats.hpp>since 0.6.0struct Stats { std::size_t vertices, triangles, edges, boundary_loops, components, non_manifold_edges, non_manifold_vertices; int euler_characteristic, genus; bool closed, manifold, oriented; double area, volume; AABB bounds; static Stats of(MeshView); };
One pass answering most pre-flight questions. genus is -1 and volume 0.0 when their precondition fails.
rf::Stats::ofmethod<ridgeforge/stats.hpp>since 0.6.0static Stats of(MeshView);
Single linear pass over the mesh building one temporary edge table.
rf::Repair::weld_verticesfunc<ridgeforge/repair.hpp>since 0.6.0std::size_t weld_vertices(Mesh&, Scalar tolerance);
Merge vertices within tolerance on every axis via a uniform grid. Zero merges exact duplicates only (right for STL).
returns count of vertices removed
rf::Repair::remove_degeneratefunc<ridgeforge/repair.hpp>since 0.6.0std::size_t remove_degenerate(Mesh&, Scalar min_area);
Drop triangles at or below min_area, including those with two equal indices. Scale min_area to your model.
returns count of triangles removed
rf::Repair::remove_duplicate_trianglesfunc<ridgeforge/repair.hpp>since 0.6.0std::size_t remove_duplicate_triangles(Mesh&);
Remove triangles that repeat the same index triple.
returns count removed
rf::Repair::remove_small_componentsfunc<ridgeforge/repair.hpp>since 0.6.0std::size_t remove_small_components(Mesh&, std::size_t min_triangles);
Delete connected components below the threshold - the usual way to clear scanner speckle before decimating.
returns count of components deleted
rf::Repair::orient_consistentlyfunc<ridgeforge/repair.hpp>since 0.6.0Result<std::size_t> orient_consistently(Mesh&);
Flood-fill each component and flip faces to agree; for a closed component, flip the whole if signed volume is negative.
returns count flipped, or Status::NonManifold when an edge has >2 faces
rf::Repair::fill_holesfunc<ridgeforge/repair.hpp>since 0.6.0Result<std::size_t> fill_holes(Mesh&, std::size_t max_loop_edges);
Ear-clip every boundary loop up to max_loop_edges in its best-fit plane; non-planar loops get a centroid fan.
returns count of loops closed
rf::DecimateOptionsstruct<ridgeforge/decimate.hpp>since 0.7.0struct DecimateOptions { std::size_t target_triangles=0; float target_ratio=0; Scalar max_error=0; bool preserve_boundary=true; bool preserve_ridges=false; float ridge_angle_deg=40; float max_aspect_ratio=20; bool allow_topology_change=false; const std::vector<Index>* locked_vertices=nullptr; Progress progress=nullptr; unsigned threads=0; };
Collapse controls. At least one of target_triangles, target_ratio or max_error must be non-zero or run returns InvalidOption.
rf::Decimatorclass<ridgeforge/decimate.hpp>since 0.7.0explicit Decimator(DecimateOptions opt); Result<DecimateReport> run(Mesh& mesh);
Quadric-error edge-collapse decimator. Reusable across meshes; no state survives a run.
rf::DecimateReportstruct<ridgeforge/decimate.hpp>since 0.7.0struct DecimateReport { std::size_t collapses, triangles_before, triangles_after; double max_applied_error; bool target_reached; };
What a run did. target_reached==false with status Ok is normal when locks block the target.
rf::RidgeOptionsstruct<ridgeforge/ridge.hpp>since 0.8.0struct RidgeOptions { float min_angle_deg=35; float max_angle_deg=175; std::size_t min_edges=4; bool include_boundary=true; unsigned smooth_passes=0; bool split_at_junctions=true; };
Thresholds for which edges qualify and how chains are cut.
rf::RidgeKindenum<ridgeforge/ridge.hpp>since 0.8.0enum class RidgeKind { Ridge, Valley, Boundary };
Convex, concave or boundary; a chain changing sign is split so no line is half and half.
rf::Polylinestruct<ridgeforge/ridge.hpp>since 0.8.0struct Polyline { std::vector<Index> vertices; RidgeKind kind; float mean_angle_deg; bool closed; };
One ordered chain. closed is true when first and last vertex coincide; the repeat is not stored twice.
rf::RidgeExtractorclass<ridgeforge/ridge.hpp>since 0.8.0explicit RidgeExtractor(RidgeOptions opt); Result<RidgeSet> run(const Mesh& mesh) const;
Chains sharp edges into ordered ridge/valley polylines rather than an unsorted edge set.
rf::SelfIntersection::FindOptionsstruct<ridgeforge/selfint.hpp>since 0.9.0struct FindOptions { bool ignore_adjacent=true; std::size_t max_pairs=0; unsigned threads=0; };
Controls for exact detection; max_pairs=0 finds all.
rf::SelfIntersection::findfunc<ridgeforge/selfint.hpp>since 0.9.0Result<std::vector<TriPair>> find(MeshView, const FindOptions& = {});
Exact, tolerance-free detection through a bounding-volume hierarchy. Reports a pair iff the two closed triangles share a point.
returns list of intersecting triangle-index pairs
rf::SelfIntersection::resolvefunc<ridgeforge/selfint.hpp>since 0.9.2Result<ResolveReport> resolve(Mesh&, const ResolveOptions& = {});
Experimental. Moves vertices out of contact, else deletes the smaller offending triangle and recloses. Churns on nested shells.
rf::RemeshOptionsstruct<ridgeforge/remesh.hpp>since 0.9.0struct RemeshOptions { Scalar target_edge_length=0; unsigned iterations=5; float feature_angle_deg=40; bool project_to_input=true; bool preserve_boundary=true; Progress progress=nullptr; };
Isotropic remeshing controls. target_edge_length 0 means the input mean edge length.
rf::Remesherclass<ridgeforge/remesh.hpp>since 0.9.0explicit Remesher(RemeshOptions opt); Result<void> run(Mesh& mesh);
Split, collapse, flip and tangential relaxation for a fixed iteration count. Experimental; isotropic only.
rf::io::Formatenum<ridgeforge/io.hpp>since 0.5.0enum class Format { Auto, Obj, Ply, Stl };
Chosen by file extension unless passed explicitly.
rf::io::WriteOptionsstruct<ridgeforge/io.hpp>since 0.5.0struct WriteOptions { Format format=Format::Auto; bool binary=true; int float_digits=7; bool write_normals=false; };
Output controls; binary is ignored for OBJ.
rf::io::readfunc<ridgeforge/io.hpp>since 0.5.0Result<Mesh> read(const std::string& path); Result<Mesh> read(const std::string& path, Format);
Load OBJ, PLY (ascii+binary) or binary/ascii STL. STL has no vertex sharing, so weld after reading one.
returns the loaded Mesh, or a Status describing the failure
rf::io::writefunc<ridgeforge/io.hpp>since 0.5.0Result<void> write(const Mesh&, const std::string& path); Result<void> write(const Mesh&, const std::string& path, const WriteOptions&);
Write by extension or explicit options. OBJ and PLY carry normals and one UV set; STL carries positions only.
rf::Progressalias<ridgeforge/types.hpp>since 0.7.0using Progress = std::function<bool(float fraction, const char* stage)>;
Return false to cancel; leaves a valid intermediate mesh and returns Status::Cancelled. Called from the calling thread only.
Each card above is one object in symbols.json. The shape is small on purpose:
Signatures are the single line you would write to call the thing, not the implementation. Where a symbol gained fields over time, since marks the release it first appeared in; see the changelog for what changed. Full prose for each lives in the API narrative.