Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return a 2d convex hull when the input only has points in a plane #36

Merged
merged 1 commit into from
Jun 15, 2024

Conversation

mauriciopoppe
Copy link
Owner

@mauriciopoppe mauriciopoppe commented Jun 15, 2024

Read the thread in #30 for more info.

Algorithm:

  • Before computing the hull check if the input is degenerate i.e. check if all the points are in the same plane
    • Pick 3 points and get a plane, project all the points towards the plane i.e. find the distance to the plane, if the projection distance is 0 for all the points then it means that all the points are in the same plane
    • Translate the origin so that one of the 3 points becomes the origin, rotate the frame so that the plane is parallel to a plane formed by any 2 of the 3 axis e.g. any of the xy, xz, yz planes
    • Discard the dimension where all the values are 0.
    • Do a 2d convex hull
    • Create a face where the indexes are the indexes of the convex hull points

Ref #30

Copy link

codecov bot commented Jun 15, 2024

Codecov Report

Attention: Patch coverage is 95.65217% with 4 lines in your changes missing coverage. Please review.

Project coverage is 91.28%. Comparing base (f554dc2) to head (022f0a7).
Report is 20 commits behind head on master.

Files Patch % Lines
src/Face.ts 92.59% 2 Missing ⚠️
src/QuickHull.ts 96.49% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #36      +/-   ##
==========================================
+ Coverage   89.36%   91.28%   +1.91%     
==========================================
  Files           6        6              
  Lines         536      608      +72     
  Branches      100      106       +6     
==========================================
+ Hits          479      555      +76     
+ Misses         52       48       -4     
  Partials        5        5              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mauriciopoppe mauriciopoppe merged commit b23dfff into master Jun 15, 2024
5 checks passed
@mauriciopoppe mauriciopoppe deleted the degenerate-plane branch June 15, 2024 23:44
src/Face.ts Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants