{"id":13532895,"url":"https://github.com/LukasBanana/GeometronLib","last_synced_at":"2025-04-01T21:31:19.997Z","repository":{"id":35474868,"uuid":"39743450","full_name":"LukasBanana/GeometronLib","owner":"LukasBanana","description":"A basic geometry C++ library for 2D and 3D applications","archived":false,"fork":false,"pushed_at":"2024-12-08T23:34:42.000Z","size":1162,"stargazers_count":95,"open_issues_count":0,"forks_count":11,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-30T10:07:52.584Z","etag":null,"topics":["cpp11","geometry-library","mesh-generator"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LukasBanana.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-26T21:50:55.000Z","updated_at":"2025-02-22T21:28:34.000Z","dependencies_parsed_at":"2024-04-13T01:58:24.964Z","dependency_job_id":"5ab9f0b3-1cfd-4cab-a999-45bab66753ac","html_url":"https://github.com/LukasBanana/GeometronLib","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/LukasBanana%2FGeometronLib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukasBanana%2FGeometronLib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukasBanana%2FGeometronLib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukasBanana%2FGeometronLib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LukasBanana","download_url":"https://codeload.github.com/LukasBanana/GeometronLib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246713074,"owners_count":20821836,"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":["cpp11","geometry-library","mesh-generator"],"created_at":"2024-08-01T07:01:14.684Z","updated_at":"2025-04-01T21:31:14.987Z","avatar_url":"https://github.com/LukasBanana.png","language":"C++","funding_links":[],"categories":["Libraries"],"sub_categories":["C++"],"readme":"GeometronLib - Basic Geometry Library for 2D/3D Apps in modern C++\n==================================================================\n\nOverview\n--------\n\n- **Version**: 1.00 Alpha\n- **License**: [3-Clause BSD License](https://github.com/LukasBanana/GaussianLib/blob/master/LICENSE.txt)\n- **Documentation**: [GeometronLib Docu.pdf](https://github.com/LukasBanana/GeometronLib/blob/master/docu/GeometronLib%20Docu.pdf)\n\n\nDependencies\n------------\n\nUsing this library requires the [GaussianLib](https://github.com/LukasBanana/GaussianLib)\n\n\nMesh Generator\n--------------\n\nThere is a generic mesh generator for the following 3D models:\n\n![Cuboid](docu/images/mesh/cuboid.png)\n![Ellipsoid](docu/images/mesh/ellipsoid.png)\n![Cone](docu/images/mesh/cone.png)\n![Cylinder](docu/images/mesh/cylinder.png)\n![Pie](docu/images/mesh/pie.png)\n![Pipe](docu/images/mesh/pipe.png)\n![Capsule](docu/images/mesh/capsule.png)\n![Torus](docu/images/mesh/torus.png)\n![TorusKnot](docu/images/mesh/torusknot.png)\n![Spiral](docu/images/mesh/spiral.png)\n\n\nRay/Geometry Intersection\n-------------------------\n\nThe interesction functions can be used to select objects in an editor or even basic software ray tracing:\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"docu/images/raytracing.png\"/\u003e\u003c/p\u003e\n\n\nExample\n-------\n\nThis is an example about the mesh generator:\n```cpp\n#include \u003cGeom/Geom.h\u003e\n\nint main()\n{\n    // Generate cuboid\n    Gm::MeshGenerator::CuboidDescriptor cuboidDesc;\n    {\n        // Triangle segmentation (like a static tessellation) for X, Y, and Z axis\n        cuboidDesc.segments         = { 1, 2, 3 };\n\n        // Cuboid size in X, Y, and Z direction\n        cuboidDesc.size             = { 2, 0.5, 1.5 };\n\n        // UV-Texture-Coordinate scaling in X, Y, and Z direction\n        cuboidDesc.uvScale          = { 2, 0.5, 1.5 };\n\n        // Alternate the triangle grid (looks more uniform)\n        cuboidDesc.alternateGrid    = true;\n    }\n    auto cuboidMesh = Gm::MeshGenerator::GenerateCuboid(cuboidDesc);\n\n    /* ... */\n}\n```\n\nThis is an example about the primitive data types such as Plane, Ray etc.:\n```cpp\n#include \u003cGeom/Geom.h\u003e\n#include \u003ciostream\u003e\n\n// \"Gm\" is the namespace of \"GeometronLib\" for planes, rays, bounding-boxes, transformations, etc.\n// \"Gs\" is the namespace of \"GaussianLib\" for vectors, matrices, and quaternions\n\nstatic const Gs::Real pi = Gs::Real(3.141592654);\n\nint main()\n{\n    // Plane\n    Gm::Plane p;\n\n    p.normal = Gs::Vector3(1, 1, 1).Normalized();\n    p.distance = 0;\n\n    // 2D Ray\n    Gm::Ray2 r;\n\n    r.origin = Gs::Vector2(0, 0);\n    r.direction = Gs::Vector2(3, 2).Normalized();\n\n    std::cout \u003c\u003c \"Ray(t) = \" \u003c\u003c std::endl \u003c\u003c r \u003c\u003c std::endl;\n\n    // 3D Oriented Bounding-Box (OBB)\n    Gm::OBB3 o;\n    //...\n\n    // 2D Axis-Aligned Bounding-Box (AABB)\n    Gm::AABB2 a;\n\n    a.min = Gs::Vector2(-1, -2);\n    a.max = Gs::Vector2(3, 5);\n\n    std::cout \u003c\u003c \"AABB Size = \" \u003c\u003c a.Size() \u003c\u003c std::endl;\n\n    // 2D Transformation (with affine 3x3 matrix)\n    Gm::Transform2 t2;\n\n    t2.SetPosition(Gs::Vector2(4, -3));\n    t2.SetRotation(pi*0.5);\n    t2.SetScale(Gs::Vector2(5, 2));\n\n    Gs::AffineMatrix3 A = t2.GetMatrix();\n\n    std::cout \u003c\u003c \"2D Transform:\" \u003c\u003c std::endl \u003c\u003c A \u003c\u003c std::endl;\n\n    // 3D Transformation (with affine 4x4 matrix)\n    Gm::Transform3 t3;\n\n    t3.SetPosition(Gs::Vector3(5, -2, 6));\n    t3.SetRotation(Gs::Quaternion::EulerAngles(Gs::Vector3(pi*0.5, 0, -pi*0.25)));\n    t3.SetScale(Gs::Vector3(1, 2, 3));\n\n    Gs::AffineMatrix4 B = t3.GetMatrix();\n\n    std::cout \u003c\u003c \"3D Transform:\" \u003c\u003c std::endl \u003c\u003c B \u003c\u003c std::endl;\n\n    return 0;\n}\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLukasBanana%2FGeometronLib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLukasBanana%2FGeometronLib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLukasBanana%2FGeometronLib/lists"}