+ You need to train a model with normals to use poisson meshing. Try tsdf
+ or retrain the model with normals. You can use nerfacto with
+ --pipeline.model.predict-normals True
+
+ );
+ } else {
+ // if valid, provide the command needed for creating the mesh
+ inner_html = (
+ <>
+
+ Run the following command in a terminal to export the mesh:
+
+
{cmd}
+
+ }
+ onClick={handleCopy}
+ >
+ Copy Command
+
+
+ >
+ );
+ }
+
+ return
{inner_html}
;
+}
diff --git a/nerfstudio/viewer/app/src/modules/SidePanel/ExportPanel/PointcloudSubPanel.jsx b/nerfstudio/viewer/app/src/modules/SidePanel/ExportPanel/PointcloudSubPanel.jsx
index 8951c8051..480f3694c 100644
--- a/nerfstudio/viewer/app/src/modules/SidePanel/ExportPanel/PointcloudSubPanel.jsx
+++ b/nerfstudio/viewer/app/src/modules/SidePanel/ExportPanel/PointcloudSubPanel.jsx
@@ -1,5 +1,4 @@
import * as React from 'react';
-import * as THREE from 'three';
import { useControls, useStoreContext } from 'leva';
import { useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux';
@@ -7,11 +6,9 @@ import ContentCopyRoundedIcon from '@mui/icons-material/ContentCopyRounded';
import { Button } from '@mui/material';
-const PCD_CLIPPING_BOX_NAME = 'PCD Clipping Box';
-
export default function PointcloudSubPanel(props) {
- const sceneTree = props.sceneTree;
- const showExportBox = props.showExportBox;
+ const update_box_center = props.update_box_center;
+ const update_box_scale = props.update_box_scale;
const store = useStoreContext();
const dispatch = useDispatch();
@@ -32,27 +29,6 @@ export default function PointcloudSubPanel(props) {
const config_filename = `${config_base_dir}/config.yml`;
- const geometry = new THREE.BoxGeometry(1, 1, 1);
- const material = new THREE.MeshBasicMaterial({
- color: 0xffd369,
- transparent: true,
- opacity: 0.7,
- side: THREE.DoubleSide,
- });
- const cube = new THREE.Mesh(geometry, material);
- sceneTree.set_object_from_path([PCD_CLIPPING_BOX_NAME], cube);
- cube.visible = showExportBox && clippingEnabled;
-
- const update_box_center = (value) => {
- const box = sceneTree.find_object_no_create([PCD_CLIPPING_BOX_NAME]);
- box.position.set(value[0], value[1], value[2]);
- };
-
- const update_box_scale = (value) => {
- const box = sceneTree.find_object_no_create([PCD_CLIPPING_BOX_NAME]);
- box.scale.set(value[0], value[1], value[2]);
- };
-
const controlValues = useControls(
{
numPoints: { label: 'Number of Points', value: 1000000, min: 1 },
@@ -62,8 +38,6 @@ export default function PointcloudSubPanel(props) {
label: 'Crop',
value: clippingEnabled,
onChange: (value) => {
- const box = sceneTree.find_object_no_create([PCD_CLIPPING_BOX_NAME]);
- box.visible = value;
dispatch({
type: 'write',
path: 'renderingState/clipping_enabled',
@@ -102,7 +76,7 @@ export default function PointcloudSubPanel(props) {
});
},
},
- outputDir: { label: 'Output Directory', value: 'pcd/' },
+ outputDir: { label: 'Output Directory', value: 'exports/pcd/' },
},
{ store },
);
diff --git a/scripts/exporter.py b/scripts/exporter.py
index a739b8814..658d5e191 100644
--- a/scripts/exporter.py
+++ b/scripts/exporter.py
@@ -58,7 +58,7 @@ class ExportPointCloud(Exporter):
"""Minimum of the bounding box, used if use_bounding_box is True."""
bounding_box_max: Tuple[float, float, float] = (1, 1, 1)
"""Minimum of the bounding box, used if use_bounding_box is True."""
- num_rays_per_batch: int = 65536
+ num_rays_per_batch: int = 32768
"""Number of rays to evaluate per batch. Decrease if you run out of memory."""
std_ratio: float = 10.0
"""Threshold based on STD of the average distances across the point cloud to remove outliers."""
@@ -195,7 +195,7 @@ class ExportPoissonMesh(Exporter):
"""Minimum of the bounding box, used if use_bounding_box is True."""
bounding_box_max: Tuple[float, float, float] = (1, 1, 1)
"""Minimum of the bounding box, used if use_bounding_box is True."""
- num_rays_per_batch: int = 65536
+ num_rays_per_batch: int = 32768
"""Number of rays to evaluate per batch. Decrease if you run out of memory."""
texture_method: Literal["point_cloud", "nerf"] = "nerf"
"""Method to texture the mesh with. Either 'point_cloud' or 'nerf'."""