google / google/draco

how to understand draco::EncoderOptions

Open
#925 1 comment 0 reactions 0 assignees View on GitHub
Waiting Response
Dominant language
C++
Stars
7.5k
Forks
1.1k
Avg merge
47m
Merged PRs (30d)
1

Description

Can somebody help me understand the below function?

I am struggling to understand draco::EncoderOptions
This is the function implemented by the former worker. After getting this draco process, the intensity values seem to be different with original value. May I know how to get the original value in cesium side?

```
draco::PointCloudBuilder builder;
draco::EncoderBuffer encoder_buffer;
draco::PointCloudSequentialEncoder encoder;
draco::EncoderOptions options = draco::EncoderOptions::CreateDefaultOptions();
```

```
void DPNTSGenerator::finalizePoints()
{
const auto point_cloud = builder.Finalize(false);

options.SetAttributeFloat(point_cloud->GetNamedAttributeId(draco::GeometryAttribute::POSITION), "quantization_bits", 14);
options.SetAttributeFloat(point_cloud->GetNamedAttributeId(draco::GeometryAttribute::NORMAL), "quantization_bits", 14);
options.SetAttributeInt(point_cloud->GetNamedAttributeId(draco::GeometryAttribute::COLOR), "quantization_bits", 8);
options.SetAttributeFloat(intensity_id, "quantization_bits", 14);

encoder.SetPointCloud(*point_cloud);

encoder_buffer.Clear();
const auto status = encoder.Encode(options, &encoder_buffer);
if (!status.ok())
{
// failed to encode
std::cerr << status << std::endl;
return;
}

const auto& buffer = encoder_buffer;
writeFeatureTableBinary(buffer.data(), buffer.size());
}
```

I have tried to adjust there parameters

```
options.SetAttributeFloat(point_cloud->GetNamedAttributeId(draco::GeometryAttribute::POSITION), "quantization_bits", 14);
options.SetAttributeFloat(point_cloud->GetNamedAttributeId(draco::GeometryAttribute::NORMAL), "quantization_bits", 14);
options.SetAttributeInt(point_cloud->GetNamedAttributeId(draco::GeometryAttribute::COLOR), "quantization_bits", 8);
options.SetAttributeFloat(intensity_id, "quantization_bits", 14);
```

But I can't get satisfactory results.

Is there any mention of the API's comment of SetAttributeFloat?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.