Memory Requirements for Remeshing Large High‑Polygon Meshes with AutoRemesher
AutoRemesher requires approximately 2–3 GiB of RAM to remesh a 5–10 million‑vertex mesh, scaling linearly to 4–5 GiB or more for 20 million‑vertex models, because the algorithm maintains several simultaneous copies of vertex and face data plus auxiliary per‑vertex buffers.
Processing high‑polygon assets in huxingyi/autoremesher involves substantial memory overhead. The codebase allocates multiple redundant mesh representations—original data, a Geogram geometry‑engine copy, per‑vertex attribute fields, and temporary buffers—causing RAM usage to grow roughly linearly with vertex and face counts. Understanding these memory requirements helps prevent crashes on large production models and guides hardware sizing decisions.
How AutoRemesher Consumes Memory
AutoRemesher’s memory footprint is dominated by geometry duplication and attribute storage. The application does not operate on a single in‑place mesh; instead, it forks data into separate structures used by the remeshing kernel, the parameterization stage, and the underlying Geogram library.
Vertex and Face Storage
The baseline memory cost begins with the input mesh itself. In src/AutoRemesher/autoremesher.cpp, vertices are stored as Vector3 (three doubles, 24 bytes each), while faces are stored as index triples in std::vector<size_t> containers (24 bytes per triangle). For a mesh with N vertices and F faces, this baseline alone consumes 24 × N + 24 × F bytes.
Per‑Vertex Attribute Buffers
The parameterizer.cpp file allocates several additional per‑vertex arrays required for curvature‑aware remeshing:
- Per‑vertex normals:
Vector3(24 B) - Per‑vertex curvature:
double(8 B) - Per‑vertex target edge length:
double(8 B) - UV coordinates (optional):
Vector2(16 B)
These add roughly 56–72 bytes per vertex depending on which features are enabled.
Geogram Mesh Copy
AutoRemesher relies on the Geogram library (thirdparty/geogram/) for robust mesh representation. According to the source in thirdparty/geogram/geogram-1.8.3/src/lib/geogram/, the library creates a second full copy of the mesh geometry. This duplication effectively doubles the base vertex and face storage, contributing another 48 × N + 48 × F bytes to the working set.
Memory Calculation Formula
Summing the major, always‑present contributions yields a practical estimation formula:
Memory ≈ 112 × N + 48 × F bytes
- 112 × N accounts for the original vertices, Geogram copy, normals, curvature, and target edge lengths.
- 48 × F accounts for the original faces, Geogram copy, and temporary face buffers.
Practical Example: 5 M Vertices / 10 M Triangles
For a high‑polygon scan with 5 000 000 vertices and 10 000 000 triangles:
- Vertex data: 112 × 5 000 000 ≈ 560 MiB
- Face data: 48 × 10 000 000 ≈ 480 MiB
- Baseline total: ~1.04 GiB
Adding STL container overhead, TBB thread‑local storage, and scratch buffers used during island separation in meshseparator.cpp, a safe rule of thumb is to allocate 2–3 GiB for meshes in this range. A 20 million‑vertex model scales linearly to roughly 4–5 GiB or more.
Source Code Evidence
The following files confirm why memory scales linearly and where the largest allocations occur:
src/AutoRemesher/autoremesher.cpp– Core driver that allocates the primary vertex and face buffers before handing data to the remeshing pipeline.src/AutoRemesher/parameterizer.cpp– Generates per‑vertex curvature and scaling fields, adding the extra 24 + 8 + 8 bytes per vertex.src/AutoRemesher/meshseparator.cpp– Splits the mesh into islands; each island temporarily holds its own copy of vertices and faces, spiking memory during pre‑processing.thirdparty/geogram/geogram-1.8.3/src/lib/geogram/– Geometry library that instantiates a parallel mesh representation, doubling base geometry storage.thirdparty/isotropicremesher/isotropicremesher.cpp– Fast isotropic remeshing kernel that works on its own vertex/triangle buffers, creating yet another temporary copy during the remeshing pass.
Optimizing Memory Usage for Large Meshes
You can reduce the memory footprint without sacrificing output quality by adjusting parameters that control subdivision density:
- Decrease
--target-quads. Higher target counts force the algorithm to maintain denser intermediate representations, increasing both vertex and face counts during processing. - Lower
--adaptivity. Values below1.0reduce refinement in thin or high‑curvature areas, which lowers the number of subdivisions and thus temporary buffer sizes. - Process in chunks. For extremely large scans, consider cropping the mesh into overlapping sections, remeshing each separately, and merging the results.
Command‑Line Examples
Run the CLI on a high‑polygon OBJ file while monitoring memory usage:
# Remesh a 5 M‑vertex scan to 200 k quads (expect ~2–3 GiB peak)
./autoremesher \
--input big_model.obj \
--output big_model_remeshed.obj \
--report big_report.txt \
--target-quads 200000 \
--edge-scaling 1.0 \
--sharp-edge 90.0 \
--smooth-normal 0.0 \
--adaptivity 1.0
Limit RAM on a modest machine by reducing adaptive refinement:
# Lower adaptivity to decrease subdivision in thin areas
./autoremesher \
--input huge_model.obj \
--output huge_model_remeshed.obj \
--target-quads 100000 \
--adaptivity 0.8
Summary
- AutoRemesher’s memory usage scales roughly as 112 bytes per vertex plus 48 bytes per triangle.
- A 5 million‑vertex / 10 million‑triangle mesh requires 1 GiB baseline and 2–3 GiB safe allocation.
- The Geogram library and
meshseparator.cppcreate duplicate mesh copies, doubling base geometry storage. - Adjusting
--target-quadsand--adaptivityreduces peak memory for large assets. - For production meshes exceeding 10 million vertices, use a workstation with at least 8 GiB RAM to accommodate OS, UI, and algorithm overhead.
Frequently Asked Questions
How much RAM do I need to remesh a 10 million‑polygon mesh with AutoRemesher?
A 10 million‑triangle mesh with roughly 5 million vertices requires 2–3 GiB of free RAM. If the mesh is denser (e.g., 10 million vertices), plan for 4–5 GiB to account for the Geogram copy, per‑vertex attributes, and temporary buffers created in meshseparator.cpp and isotropicremesher.cpp.
Why does AutoRemesher consume more memory than the original OBJ file size?
The tool keeps multiple representations simultaneously: the original data, a Geogram geometry copy, per‑vertex normals and curvature arrays, and temporary working buffers for island separation. This redundancy ensures robustness and speed but increases the working set to roughly 2–3× the raw file size.
Can I reduce memory usage without lowering the target quad count?
Yes. Lower the --adaptivity parameter below 1.0. This restricts adaptive subdivision in high‑curvature or thin regions, reducing the number of temporary vertices generated during the remeshing pass in parameterizer.cpp and lowering peak RAM usage.
Does the Qt GUI version use significantly more RAM than the CLI?
The GUI adds OpenGL buffer overhead and Qt widget allocations. For meshes above 10 million vertices, allocate at least 8 GiB system RAM when using the GUI, whereas the headless CLI (autoremesher binary) can often run safely with 4–6 GiB on the same dataset.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →