DeepSDFStruct.deep_sdf.generate_primitive_dataset#

Primitive-Scene Training Data Generator#

Generates training scenes of simple geometric primitives (spheres, boxes, cylinders) randomly positioned, oriented, and scaled inside a bounding box. The ground-truth SDF is computed analytically by combining the primitive SDFs with the minimum operation (UnionSDF).

For each scene the SDF is sampled in two complementary ways:
  • uniformly in the volume (random_sample_sdf), and

  • near the surface via Gaussian perturbations at several standard deviations (sample_mesh_surface).

The output is written in the layout consumed by SDFSamples in training_latent_field.py:

<data_source>/
├── SdfSamples/<dataset_name>/<class_name>/<instance>.npz   # pos/neg, [x,y,z,sdf]
├── SdfSamples/<dataset_name>/<vtp_subdir>/<instance>.vtp   # ParaView point clouds
└── splits/<split_name>.json                                # {dataset:{class:[instance,...]}}

Run directly to generate a dataset using the editable CONFIG dict at the bottom of this file:

python -m DeepSDFStruct.deep_sdf.generate_primitive_dataset

Functions

generate_primitive_dataset(cfg)

Generate a primitive-scene SDF dataset according to cfg.

DeepSDFStruct.deep_sdf.generate_primitive_dataset.generate_primitive_dataset(cfg)#

Generate a primitive-scene SDF dataset according to cfg.

Returns the dataset summary dict (also written to summary.json).

Return type:

dict

Parameters:

cfg (dict)