{"id":13442405,"url":"https://github.com/thi-ng/geom","last_synced_at":"2025-05-14T01:04:16.913Z","repository":{"id":14282472,"uuid":"16990539","full_name":"thi-ng/geom","owner":"thi-ng","description":"2D/3D geometry toolkit for Clojure/Clojurescript","archived":false,"fork":false,"pushed_at":"2025-03-22T14:59:18.000Z","size":8971,"stargazers_count":966,"open_issues_count":30,"forks_count":76,"subscribers_count":49,"default_branch":"feature/no-org","last_synced_at":"2025-05-12T05:19:02.060Z","etag":null,"topics":["charts","geometry","mesh-generation","obj","opengl","ply","stl","subdivision","svg","visualization","voxel","webgl"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thi-ng.png","metadata":{"files":{"readme":"README.org","changelog":"CHANGELOG.org","contributing":null,"funding":null,"license":"LICENSE","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":"2014-02-19T16:25:37.000Z","updated_at":"2025-04-28T05:15:05.000Z","dependencies_parsed_at":"2023-02-12T16:30:52.401Z","dependency_job_id":"17c865a7-8c94-4677-8cf5-337cd6a85b5c","html_url":"https://github.com/thi-ng/geom","commit_stats":{"total_commits":1229,"total_committers":14,"mean_commits":87.78571428571429,"dds":"0.024410089503661525","last_synced_commit":"b506ca571f0f678842badfdbe17e75250119e0cd"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thi-ng%2Fgeom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thi-ng%2Fgeom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thi-ng%2Fgeom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thi-ng%2Fgeom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thi-ng","download_url":"https://codeload.github.com/thi-ng/geom/tar.gz/refs/heads/feature/no-org","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253695837,"owners_count":21948943,"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":["charts","geometry","mesh-generation","obj","opengl","ply","stl","subdivision","svg","visualization","voxel","webgl"],"created_at":"2024-07-31T03:01:45.333Z","updated_at":"2025-05-14T01:04:16.889Z","avatar_url":"https://github.com/thi-ng.png","language":"Clojure","funding_links":[],"categories":["Clojure","Awesome ClojureScript"],"sub_categories":["Graphics"],"readme":"#+SETUPFILE: ./meta/setup.org\n#+TITLE: thi.ng/geom\n\n[[./assets/voxel/svo-d7.jpg]]\n\n* Contents                                                         :toc_3_gh:\n - [[#about-the-project][About the project]]\n     - [[#status][Status]]\n     - [[#leiningen-coordinates][Leiningen coordinates]]\n         - [[#latest-snapshot][Latest snapshot]]\n         - [[#latest-stable][Latest stable]]\n         - [[#additional-dependencies-for-jogl][Additional dependencies for JOGL]]\n     - [[#overview][Overview]]\n         - [[#example-usage][Example usage]]\n         - [[#project-structure][Project structure]]\n         - [[#main-features-non-exhaustive-list][Main features (non-exhaustive list)]]\n         - [[#api-scope][API scope]]\n     - [[#project-structure][Project structure]]\n         - [[#core][core]]\n         - [[#types][types]]\n         - [[#utils][utils]]\n         - [[#mesh][mesh]]\n         - [[#physics][physics]]\n         - [[#svg][svg]]\n         - [[#viz][viz]]\n         - [[#voxel][voxel]]\n         - [[#opengl--webgl][OpenGL \u0026 WebGL]]\n     - [[#release-history--changelog][Release history \u0026 changelog]]\n     - [[#contributors][Contributors]]\n     - [[#license][License]]\n\n* About the project\n\n** Status\n\nThe project was in active, almost daily development from late 2011 - summer 2016\nduring its 4th iteration/rewrite cycle. Originally developed in a Literate\nProgramming style using Emacs \u0026 Org-mode, in May 2018 it was decided to revert\nto a traditional Clojure project setup to encourage more contributions from\nother interested parties. The original .org source files are kept for reference\nin the [[./org/]] directory until further notice.\n\nRegardless of version number, the library is mature and has been used\nsuccessfully in several commercial projects over the past 10 years and can be\nconsidered stable for most use cases.\n\n** Leiningen coordinates\n\n#+BEGIN_SRC clojure\n  [thi.ng/geom \"1.0.1\"]\n#+END_SRC\n\n*** Additional dependencies for JOGL\n\nIf you're intending to use this library's OpenGL functionality under\nClojure (not ClojureScript), the following additional native\ndependencies must be added to your project (for each platform you\nintend to use):\n\n#+BEGIN_SRC clojure\n[org.jogamp.gluegen/gluegen-rt \"2.3.2\" :classifier \"natives-macosx-universal\"]\n[org.jogamp.jogl/jogl-all \"2.3.2\" :classifier \"natives-macosx-universal\"]\n#+END_SRC\n\nThe full list of supported platform =:classifier='s:\n\n| natives-android-aarch64.jar  |\n| natives-android-armv6.jar    |\n| natives-linux-amd64.jar      |\n| natives-linux-armv6.jar      |\n| natives-linux-armv6hf.jar    |\n| natives-linux-i586.jar       |\n| natives-macosx-universal.jar |\n| natives-solaris-amd64.jar    |\n| natives-solaris-i586.jar     |\n| natives-windows-amd64.jar    |\n| natives-windows-i586.jar     |\n\n** Overview\n\nthi.ng/geom is a comprehensive and modular geometry \u0026 visualization\ntoolkit for Clojure/ClojureScript. It provides a large set of purely\nmath \u0026 geometry oriented data types, a polymorphic, largely protocol\nbased API to transform/convert types and various ways to create\ninteractive visualizations in SVG, WebGL, OpenGL, both in the browser\nand in desktop environments.\n\nEmbracing Clojure's approach of data transformations, the library's\ncore philosophy is based on a functional approach to generative design\ntasks with hundreds of hours spent on refining \u0026 optimizing the core\nAPI for both Clojure \u0026 Clojurescript.\n\nUnlike most other open source projects, this project has been\ndeveloped in a literate programming style and has been in active,\nregular development since late 2011, currently in its 4th\niteration/rewrite cycle.\n\n*You're highly encouraged to consult the source code, which contains\ndocumentation, examples, diagrams and general usage pattern hints.*\n\nThis project is part of the [[https://github.com/thi-ng/][thi.ng]] collection of Clojure \u0026\nClojurescript libraries and makes uses of several other projects in\nthis collection (see dependencies further below).\n\n*** Example usage\n\nA growing number (currently ~40) of small examples are included in\nthis repo under the =/examples= directory:\n\n- [[./org/examples/gl/jogl.org][OpenGL demos]] (Clojure)\n- [[./org/examples/gl/webgl.org][WebGL demos]] (Clojurescript + links to live versions)\n- [[./org/examples/svg/demos.org][SVG examples]] (incl. 3D rendered meshes in SVG)\n- [[./org/examples/viz/demos.org][Visualization examples]] (charts, heatmaps, timelines etc.)\n- [[./org/examples/ptf/demos.org][PTF mesh examples]] (mesh skinning \u0026 Luxrender)\n- [[./org/examples/voxel/demos.org][Voxel examples]] (isosurface extraction from volumetric data)\n\nInteractive examples:\n\n- [[http://dev.thi.ng/gradients/][Procedural Color Gradient designer]]\n- [[http://demo.thi.ng/geom/physics/strands.html][SVG physics strands]]\n- [[http://demo.thi.ng/ws-ldn-5/][WebGL workshop teaser]]\n- [[http://demo.thi.ng/sjo/][WebGL workshop example]] (early game prototype)\n\nGrowing list of [[http://workshop.thi.ng/][thi.ng workshop]] repositories (These workshops were\nrunning on a monthly basis \u0026 internationally in 2015/2016):\n\n- [[http://thi.ng/ws-ldn-1][WS-LDN-1]]\n- [[http://thi.ng/ws-ldn-2][WS-LDN-2]]\n- [[http://thi.ng/ws-bln-1][WS-BLN-1]]\n- WS-LDN-5 (WebGL, source code forthcoming)\n- WS-LDN-6 (Desktop apps, OpenGL/WebGL, source code forthcoming)\n- [[http://thi.ng/ws-ldn-8][WS-LDN-8]] (WebGL, WebRTC, Web workers, asm.js)\n\nA preliminary list of other projects using this library:\n\n- [[https://medium.com/@thi.ng/evolutionary-failures-part-1-54522c69be37][HOLO Magazine cover \u0026 guest design]]\n- [[https://github.com/postspectacular/devart-codefactory/][Google DevArt Co(de)Factory]]\n- [[https://github.com/jackrusher/geometer/][Geometer]] (by [[https://github.com/jackrusher][Jack Rusher]])\n- [[http://holiday2014.movingbrands.com][MB Home installation]]\n- [[http://github.com/learn-postspectacular/resonate-workshop-2015][Resonate 2015 workshop]]\n- [[https://github.com/learn-postspectacular/resonate-workshop-2014][Resonate 2014 workshop]]\n- [[http://github.com/thi-ng/luxor][thi.ng/luxor]]\n- [[http://github.com/thi-ng/morphogen][thi.ng/morphogen]]\n- [[http://thi.ng/][thi.ng website]]\n\n*** Project structure\n\nUse the diagram below to quickly navigate to any namespace in the\nproject. Nodes in the graph have tooltips with a brief description of\neach namespace. *Note:* Due to GH restrictions on SVG files, first\nclick anywhere on the diagram before trying to navigate to a specific\nnamespace.\n\n[[./assets/overview.svg]]\n\n*** Main features (non-exhaustive list)\n\n- Comprehensive \u0026 optimized 2D/3D vector \u0026 matrix algebra / transformations\n- Custom, optimized vector types w/ GLSL style vector swizzling \u0026 full\n  Clojure sequence API support\n- Unified, easy-to-learn \u0026 extensible core API defined via ~50 polymorphic protocols\n- Unified OpenGL (v3.3+) \u0026 WebGL abstractions of common features,\n  shader, buffer \u0026 texture utilities\n- Declarative GLSL shader specs and code generation\n- Optional OpenGL/WebGL shader presets based on [[http://thi.ng/shadergraph][thi.ng/shadergraph]]\n- Declarative OpenGL/WebGL FBO-based multi-pass shader pipeline\n  creation \u0026 execution tools\n- OpenGL helpers for desktop apps (wrapping [[http://jogamp.org/jogl][JOGL]])\n- React.js component helpers for WebGL\n- 3D SVG mesh renderer with software facet shader support\n- SVG generation API \u0026 optional conversion of geom types\n- Declararitve 2D data visualization module with various modes (area,\n  bar, line, scatter, contours, stacks etc., cartesian/polar axes)\n- 35+ custom (mainly immutable) geometry types implementing core protocols\n- Shape analysis (surface area, circumference, distance \u0026 volume\n  calculations) for all implemented types\n- 2D/3D intersection \u0026 classification checks (vs. point, line, ray, shapes)\n- Access entities as graph-like structures (vertices/edges)\n- 2D/3D platonic entity to 3D polygon mesh conversion (w/ many options)\n- Optimized conversions to OpenGL/WebGL (with attributes, indexed, non-indexed)\n- Flexible \u0026 customizable mesh vertex attribute generators\n- Subdivision meshes (Catmull-Clark, Doo-Sabin, Butterfly)\n- Parallel-transport frame sweep mesh generation from point sequences\n  (skinning with arbitrary profiles, incl. profile morphing)\n- 3D Lathe meshes from 2D curves\n- 2D shape extrusions as 3D mesh (solid or walled)\n- Delaunay triangulation of 2D point clouds\n- Tesselation of simple 2D polygons (no holes)\n- Basic SVG =\u003cpath\u003e= parsing with different segment types\n- Basic insetting of simple 2D polygons (no miter support)\n- Shape subdivision (only lines, triangles, rects, quads, tetrahedrons)\n- Shape boundary sampling (at fixed resolution or uniform distance)\n- Sutherland-Hodgeman clipping of 2D polygons\n- 3D Boolean (CSG) operations on meshes (union, difference, intersection)\n- 3D geometry export (PLY, STL, OBJ, OFF formats)\n- 3D mesh repair tools (T-junctions, unify vertices etc.)\n- 2D/3D particle based Verlet Physics with customizable behaviors \u0026 constraints\n- 2D convex hull\n- 2D/3D quadtree/octree (mutable) for fast spatial indexing\n- Automatic curve generation from point seqs (cubic, Chaikin etc.)\n- Unfolding of 3D meshes to 2D (WIP) for digital fabrication\n...\n\n*** API scope\n\nSince the core library does only deal with pure \"platonic\" geometry\ntypes, it doesn't directly address any display or rendering\nfunctionality at all. However a number of support modules are\nprovided, incl. OpenGL 3/4, WebGL \u0026 SVG support, to allow visualizing\nresults and/or exporting generated assets. 2D/3D shape/mesh exporters\nare provided as well and together with sister libraries like\n[[https://github.com/thi-ng/luxor][thi.ng/luxor]], it's also possible to generate complete 3D scenes for\nhigh quality \u0026 high resolution non-realtime rendering using [[https://github.com/LuxRender][Luxrender]] now [[https://luxcorerender.org/][LuxCoreRender]].\n\nFurthermore, providing all functionality under a common API for both\nClojure \u0026 Clojurescript, makes it trivial to offload heavy operations\n(e.g. large mesh processing) to the server side.\n\n** Project structure\n*** core\n\n[[./src/thi/ng/geom/][source]]\n\nThese namespaces define the core functionality of this library,\nincluding the approx. 50 protocols and implementations of fundamental\ngeometry types/functions like 2d/3d vector algebra, matrices,\nquaternion (+ related convenience constructors \u0026 conversions)\n\n*** types\n\n[[./src/thi/ng/geom/][source]]\n\nThis directory contains all high-level 2d/3d data types with their\nimplementations of the various core protocols. From a user\nperspective, these namespaces defined here provide most of this\nproject's core functionality.\n\n*** utils\n\n[[./src/thi/ng/geom/utils/][source]]\n\nA number of often needed utility functions to deal with point\ncollections, normals, path sampling, triangle properties etc. Also\nincluded here are shape intersection tests, curve subdivisions and 2D\nDelaunay triangulation.\n\n*** mesh\n\n[[./src/thi/ng/geom/mesh/][source]]\n\nSeveral tools \u0026 operations related to working with 3d meshes, incl.\nI/O, subdivisions, repair / cleaning, CSG / Boolean mesh merge,\nmesh generators (polyhedra, lathe etc.)\n\n*** physics\n\n[[./src/thi/ng/geom/physics/][source]]\n\nThis module provides a simple 2d/3d particle-based physics engine with\nVerlet integration and support for custom behaviors and constaints,\nboth for individual particles and global. Particles can be connected\nwith springs of varying stiffness as well as made interdependent using\npositive or negative force fields (attractors).\n\n*** svg\n\n[[./src/thi/ng/geom/svg/][source]]\n\nA module to help with building SVG based visualizations of geom\nentities using hiccup compatible syntax. Includes a customizable 3D\nmesh renderer w/ software shader support.\n\n*** viz\n\n[[./src/thi/ng/geom/viz/][source]]\n\nDeclarative, highly customizable 2D data visualization module with ~10\ndifferent layout methods, 3 axis types, cartesian and polar domain\nsupport. Currently SVG only, but planned to be format-independent.\n\n*** voxel\n\n[[./src/thi/ng/geom/voxel/][source]]\n\nAn experimental implementation of a in-memory sparse voxel tree (SVO)\nand related functionality to extract isosurface polygon meshes from\nthe tree.\n\n*** OpenGL \u0026 WebGL\n\n[[./src/thi/ng/geom/gl/][source]]\n\nThis module provides a unified API to common OpenGL/WebGL\nfunctionality (context creation, shader management \u0026 presets, buffer\nmanagement, textures, FBO etc.), as well as a number of optimized mesh\ntypes, conversion \u0026 rendering functions, cameras etc. to simplify the\nuse of other geometry types defined in this project with OpenGL, both on\nthe desktop and in the browser. The Clojure version wraps JOGL.\n\n** Release history \u0026 changelog\n\nSee [[./CHANGELOG.org][CHANGELOG.org]] for further details.\n\n| *Version* | *Released* | *Lein coordinates*          | *Tagged Github URL*                                          |\n|-----------+------------+-----------------------------+--------------------------------------------------------------|\n| 1.0.1     | 2023-10-23 | =[thi.ng/geom \"1.0.1\"]=     | [[https://github.com/thi-ng/geom/tree/1.0.1][1.0.1]]         |\n| 1.0.0     | 2023-01-22 | =[thi.ng/geom \"1.0.0\"]=     | [[https://github.com/thi-ng/geom/tree/1.0.0][1.0.0]]         |\n| 1.0.0-RC5 | 2022-04-23 | =[thi.ng/geom \"1.0.0-RC5\"]= | [[https://github.com/thi-ng/geom/tree/1.0.0-RC5][1.0.0-RC5]] |\n| 1.0.0-RC4 | 2019-10-07 | =[thi.ng/geom \"1.0.0-RC4\"]= | [[https://github.com/thi-ng/geom/tree/1.0.0-RC4][1.0.0-RC4]] |\n| 1.0.0-RC3 | 2018-06-01 | =[thi.ng/geom \"1.0.0-RC3\"]= | [[https://github.com/thi-ng/geom/tree/1.0.0-RC3][1.0.0-RC3]] |\n| 1.0.0-RC2 | 2018-06-01 | =[thi.ng/geom \"1.0.0-RC2\"]= | [[https://github.com/thi-ng/geom/tree/1.0.0-RC2][1.0.0-RC2]] |\n| 1.0.0-RC1 | 2018-05-31 | =[thi.ng/geom \"1.0.0-RC1\"]= | [[https://github.com/thi-ng/geom/tree/1.0.0-RC1][1.0.0-RC1]] |\n|   0.0.908 | 2015-11-08 | =[thi.ng/geom \"0.0.908\"]=   | [[https://github.com/thi-ng/geom/tree/r908][r908]]           |\n|   0.0.881 | 2015-06-21 | =[thi.ng/geom \"0.0.881\"]=   | [[https://github.com/thi-ng/geom/tree/r881][r881]]           |\n|   0.0.859 | 2015-06-15 | =[thi.ng/geom \"0.0.859\"]=   | [[https://github.com/thi-ng/geom/tree/r856][r859]]           |\n|   0.0.856 | 2015-06-14 | =[thi.ng/geom \"0.0.856\"]=   | [[https://github.com/thi-ng/geom/tree/r856][r856]]           |\n|   0.0.815 | 2015-06-01 | =[thi.ng/geom \"0.0.815\"]=   | [[https://github.com/thi-ng/geom/tree/r815][r815]]           |\n|   0.0.803 | 2015-05-26 | =[thi.ng/geom \"0.0.803\"]=   | [[https://github.com/thi-ng/geom/tree/r803][r803]]           |\n|   0.0.783 | 2015-04-27 | =[thi.ng/geom \"0.0.783\"]=   | [[https://github.com/thi-ng/geom/tree/r783][r783]]           |\n|   0.0.770 | 2015-03-29 | =[thi.ng/geom \"0.0.770\"]=   | [[https://github.com/thi-ng/geom/tree/r770][r770]]           |\n|   0.0.743 | 2015-03-23 | =[thi.ng/geom \"0.0.743\"]=   | [[https://github.com/thi-ng/geom/tree/r743][r743]]           |\n|   0.0.737 | 2015-03-22 | =[thi.ng/geom \"0.0.737\"]=   | [[https://github.com/thi-ng/geom/tree/r737][r737]]           |\n|   0.0-725 | 2015-03-15 | =[thi.ng/geom \"0.0-725\"]=   | [[https://github.com/thi-ng/geom/tree/r725][r725]]           |\n|   0.0-715 | 2015-02-25 | =[thi.ng/geom \"0.0-715\"]=   | [[https://github.com/thi-ng/geom/tree/r715][r715]]           |\n|   0.0-709 | 2015-02-22 | =[thi.ng/geom \"0.0-709\"]=   | [[https://github.com/thi-ng/geom/tree/r709][r709]]           |\n|     0.2.0 | 2014-03-10 | =[thi.ng/geom \"0.2.0\"]=     | [[https://github.com/thi-ng/geom/tree/0.2.0][0.2.0]]         |\n\n** Contributors\n\n- [[https://github.com/postspectacular][@postspectacular]]\n- [[https://github.com/vl4dimir][@vl4dimir]]\n- [[https://github.com/skrat][@skrat]]\n- [[https://github.com/acron0][@acron0]]\n- [[https://github.com/arichiardi][@arichiardi]]\n- [[https://github.com/Rovanion][@Rovanion]]\n- [[https://github.com/reitzensteinm][@reitzensteinm]]\n- [[https://github.com/stwind][@stwind]]\n- [[https://github.com/fdb][@fdb]]\n- [[https://github.com/jgmize][@jgmize]]\n- [[https://github.com/dimovich][@dimovich]]\n\n** License\n\n(c) 2013 - 2023 Karsten Schmidt\n\nThis project is open source and licensed under the [[http://www.apache.org/licenses/LICENSE-2.0][Apache Software License 2.0]].\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthi-ng%2Fgeom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthi-ng%2Fgeom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthi-ng%2Fgeom/lists"}