{"id":13731555,"url":"https://github.com/Ushio/ConeTightFitAABB","last_synced_at":"2025-05-08T04:34:35.593Z","repository":{"id":149486100,"uuid":"231051855","full_name":"Ushio/ConeTightFitAABB","owner":"Ushio","description":null,"archived":false,"fork":false,"pushed_at":"2020-05-01T03:38:41.000Z","size":2139,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-14T22:35:29.174Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ushio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-12-31T08:02:10.000Z","updated_at":"2022-11-21T11:59:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"9de4bd66-ef03-4e94-a4f5-d8ede32db16b","html_url":"https://github.com/Ushio/ConeTightFitAABB","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ushio%2FConeTightFitAABB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ushio%2FConeTightFitAABB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ushio%2FConeTightFitAABB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ushio%2FConeTightFitAABB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ushio","download_url":"https://codeload.github.com/Ushio/ConeTightFitAABB/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253001297,"owners_count":21838508,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T02:01:32.771Z","updated_at":"2025-05-08T04:34:35.568Z","avatar_url":"https://github.com/Ushio.png","language":"C++","funding_links":[],"categories":["Maths"],"sub_categories":[],"readme":"## Cone TightFit AABB\n\nThanks \nhttp://iquilezles.org/www/articles/diskbbox/diskbbox.htm\n\n```\n\ngit submodule update --init\npremake5 vs2019\n\n```\n\n## demo\n![image](demo.gif)\n![image](idea.png)\n![image](form.png)\n\n\u003c!-- \n\nT=\\begin{pmatrix} x_{ T } \\\\ y_{ T } \\\\ z_{ T } \\end{pmatrix}=P_{ 1 }-P_{ 0 }\\\\ \\overrightarrow { x } =\\begin{pmatrix} 1 \\\\ 0 \\\\ 0 \\end{pmatrix},\\overrightarrow { y } =\\begin{pmatrix} 0 \\\\ 1 \\\\ 0 \\end{pmatrix},\\overrightarrow { z } =\\begin{pmatrix} 0 \\\\ 0 \\\\ 1 \\end{pmatrix}\\\\ We\\quad wants\\\\ R\\sin { \\theta _{ x } } =R\\left\\| \\overrightarrow { x } \\times \\frac { T }{ \\left\\| T \\right\\|  }  \\right\\| =R\\frac { 1 }{ \\left\\| T \\right\\|  } \\left\\| \\overrightarrow { x } \\times T \\right\\| \\\\ and\\\\ \\overrightarrow { x } \\times T=\\begin{pmatrix} y_{ 1 }z_{ 2 }-z_{ 1 }y_{ 2 } \\\\ z_{ 1 }x_{ 2 }-x_{ 1 }z_{ 2 } \\\\ x_{ 1 }y_{ 2 }-y_{ 1 }x_{ 2 } \\end{pmatrix}=\\begin{pmatrix} 0z_{ 2 }-0y_{ 2 } \\\\ 0x_{ 2 }-1z_{ 2 } \\\\ 1y_{ 2 }-0x_{ 2 } \\end{pmatrix}=\\begin{pmatrix} 0 \\\\ -z_{ T } \\\\ y_{ T } \\end{pmatrix}\\\\ so\\\\ R\\sin { \\theta _{ x } } =R\\frac { 1 }{ \\left\\| T \\right\\|  } \\left\\| \\overrightarrow { x } \\times T \\right\\| =R\\frac { 1 }{ \\left\\| T \\right\\|  } \\sqrt { { z_{ T } }^{ 2 }+{ y_{ T } }^{ 2 } } \\\\ \\\\ =R\\sqrt { \\frac { 1 }{ { \\left\\| T \\right\\|  }^{ 2 } } \\left( { z_{ T } }^{ 2 }+{ y_{ T } }^{ 2 } \\right)  } \\\\ and\\\\ { x_{ T } }^{ 2 }+{ y_{ T } }^{ 2 }+{ z_{ T } }^{ 2 }={ \\left\\| T \\right\\|  }^{ 2 }\\\\ { y_{ T } }^{ 2 }+{ z_{ T } }^{ 2 }={ \\left\\| T \\right\\|  }^{ 2 }-{ x_{ T } }^{ 2 }\\\\ so\\\\ R\\sin { \\theta _{ x } } =R\\sqrt { \\frac { 1 }{ { \\left\\| T \\right\\|  }^{ 2 } } \\left( { \\left\\| T \\right\\|  }^{ 2 }-{ x_{ T } }^{ 2 } \\right)  } =R\\sqrt { 1-\\frac { { x_{ T } }^{ 2 } }{ { \\left\\| T \\right\\|  }^{ 2 } }  } \\\\ \\\\ and\\quad also\\\\ \\overrightarrow { y } \\times T=\\begin{pmatrix} y_{ 1 }z_{ 2 }-z_{ 1 }y_{ 2 } \\\\ z_{ 1 }x_{ 2 }-x_{ 1 }z_{ 2 } \\\\ x_{ 1 }y_{ 2 }-y_{ 1 }x_{ 2 } \\end{pmatrix}=\\begin{pmatrix} 1z_{ 2 }-0y_{ 2 } \\\\ 0x_{ 2 }-0z_{ 2 } \\\\ 0y_{ 2 }-1x_{ 2 } \\end{pmatrix}=\\begin{pmatrix} z_{ T } \\\\ 0 \\\\ -x_{ T } \\end{pmatrix}\\\\ \\overrightarrow { z } \\times T=\\begin{pmatrix} y_{ 1 }z_{ 2 }-z_{ 1 }y_{ 2 } \\\\ z_{ 1 }x_{ 2 }-x_{ 1 }z_{ 2 } \\\\ x_{ 1 }y_{ 2 }-y_{ 1 }x_{ 2 } \\end{pmatrix}=\\begin{pmatrix} 0z_{ 2 }-1y_{ 2 } \\\\ 1x_{ 2 }-0z_{ 2 } \\\\ 0y_{ 2 }-0x_{ 2 } \\end{pmatrix}=\\begin{pmatrix} -y_{ T } \\\\ x_{ T } \\\\ 0 \\end{pmatrix}\\\\ \\\\ R\\sin { \\theta _{ y } } =R\\sqrt { 1-\\frac { { y_{ T } }^{ 2 } }{ { \\left\\| T \\right\\|  }^{ 2 } }  } \\\\ R\\sin { \\theta _{ z } } =R\\sqrt { 1-\\frac { { z_{ T } }^{ 2 } }{ { \\left\\| T \\right\\|  }^{ 2 } }  } \\\\ V_{ bias }=R\\begin{pmatrix} \\sqrt { 1-\\frac { { x_{ T } }^{ 2 } }{ T\\cdot T }  }  \\\\ \\sqrt { 1-\\frac { { y_{ T } }^{ 2 } }{ T\\cdot T }  }  \\\\ \\sqrt { 1-\\frac { { z_{ T } }^{ 2 } }{ T\\cdot T }  }  \\end{pmatrix}\\\\ so\\\\ \\overrightarrow { e } =\\begin{pmatrix} \\sqrt { 1-\\frac { { x_{ T } }^{ 2 } }{ T\\cdot T }  }  \\\\ \\sqrt { 1-\\frac { { y_{ T } }^{ 2 } }{ T\\cdot T }  }  \\\\ \\sqrt { 1-\\frac { { z_{ T } }^{ 2 } }{ T\\cdot T }  }  \\end{pmatrix}\\\\ V_{ bias-xyz }=R\\overrightarrow { e } \\\\ \n\n --\u003e\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FUshio%2FConeTightFitAABB","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FUshio%2FConeTightFitAABB","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FUshio%2FConeTightFitAABB/lists"}