dimforge / dimforge/ncollide

HACD resulting in missing or unwanted solid objects

Open
#346 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
926
Forks
104
PR merge metrics
No merged PRs in 30d

Description

I'm working with concave 3D shapes (created using projected 2d polylines), and am attempting to use HACD to decompose these into convex shapes. When doing so, the resulting output seems to produce "holes", or in some cases, unexpected solid shapes. I've played with the `error` and `min_components` parameters and admittedly don't have a good grasp on how they should affect the process, but in so doing only seem to make things worse rather than better.

Also, I'm aware of #338, but would eventually like to use HACD to represent profiling operations (e.g. angled notches) in simple shapes.

I have two illustrations of this process not working as expected, [implemented as examples](https://gitlab.com/bellwether-softworks/kiss3d-test/-/tree/master/examples) using kiss3d for rendering:

## complex-orthogonal
The desired 3d shape in this example would be a projection of the following 2d shape as [represented in desmos](https://www.desmos.com/calculator/tyeasoeawj):
![image](https://user-images.githubusercontent.com/66568249/87173927-f865fa00-c2c5-11ea-92a9-5bde8851972d.png)

What I see when I attempt to perform HACD:
![image](https://user-images.githubusercontent.com/66568249/87174318-83df8b00-c2c6-11ea-8654-9c488d641f31.png)

## rounded-contour
This is a more complex example, and demonstrates behavior where the solid region seems to be inverted. In [desmos](https://www.desmos.com/calculator/ywnd4gh3ut):
![image](https://user-images.githubusercontent.com/66568249/87174855-55ae7b00-c2c7-11ea-9a1e-65c31e8b1ece.png)

...and after applying HACD (green sphere in image represents origin):
![image](https://user-images.githubusercontent.com/66568249/87175007-8f7f8180-c2c7-11ea-98b9-324ff6bb39e2.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.