{"id":23594445,"url":"https://github.com/andychase/fabian-csg","last_synced_at":"2025-08-17T08:07:36.170Z","repository":{"id":19072345,"uuid":"22299442","full_name":"andychase/fabian-csg","owner":"andychase","description":"(Written by Fabian) Constructive Shape Geometry for jme3","archived":false,"fork":false,"pushed_at":"2015-03-21T19:37:50.000Z","size":1330,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-07T22:08:32.626Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andychase.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-27T00:20:19.000Z","updated_at":"2024-11-03T12:29:30.000Z","dependencies_parsed_at":"2022-09-25T04:20:33.905Z","dependency_job_id":null,"html_url":"https://github.com/andychase/fabian-csg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andychase/fabian-csg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andychase%2Ffabian-csg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andychase%2Ffabian-csg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andychase%2Ffabian-csg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andychase%2Ffabian-csg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andychase","download_url":"https://codeload.github.com/andychase/fabian-csg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andychase%2Ffabian-csg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270820793,"owners_count":24651534,"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","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-12-27T09:18:25.103Z","updated_at":"2025-08-17T08:07:36.141Z","avatar_url":"https://github.com/andychase.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fabian CSG\r\n\r\n*A fork of this project exists here: \u003chttps://sourceforge.net/projects/jmonkeycsg/\u003e*\r\n\r\nFabian CSG ([Constructive Shape Geometry](http://en.wikipedia.org/wiki/Constructive_solid_geometry)) is a library for [jMonkeyEngine](http://jmonkeyengine.org) that allows creating dynamic models with [boolean operations](http://en.wikipedia.org/wiki/Boolean_operations_on_polygons). \r\n\r\n\r\n![Boolean Subtraction](img/1.png)  \r\n![Boolean Intersection](img/2.png)  \r\n![Boolean Difference](img/3.png)\r\n\r\n## Features\r\n\r\n- [x] Fully ported csg.js library (MIT license) to Java, using JMonkeyEngine’s Vector3f.\r\n- [x] Added function to produce a Mesh from the CSG object.\r\n- [x] Made CSG.shapeName( static functions into classes that extend CSG.\r\n- [x] Created CSGNode class, which is used to sequentially add CSG brushes and output 1 geometry (Soon to be node)\r\n- [x] Created a MeshBrush, which reads the TexCoord, Normal, Position and Index buffers of a Mesh to product a shape which can be used for CSG.\r\n- [ ] Add Material support on a per-brush level.\r\n- [ ] Add UV calculations to standard shapes (Cube, Sphere, Cylinder)\r\n- [ ] LOD support? (Or polygon reduction)\r\n\r\n## Usage\r\n\r\n```java\r\nMaterial mat_csg = assetManager.loadMaterial(“Materials/WallCover/BrownBricks.j3m”);\r\nmat_csg.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);\r\n\r\nCSGNode csg = new CSGNode();\r\ncsg.setMaterial(mat_csg);\r\n\r\nCubeBrush base = new CubeBrush(new Vector3f(0f, 0f, 0f), new Vector3f(1f, 1f, 1f));\r\ncsg.addBrush(base);\r\n\r\nSphereBrush hole = new SphereBrush(new Vector3f(0f, 0f, 0f), 1.3f, 16, 8);\r\nhole.setType(BrushType.SUBTRACTIVE);\r\n\r\ncsg.addBrush(hole);\r\ncsg.regenerate();\r\ncsg.move(0f, 1f, 0f);\r\n\r\nthis.app.getRootNode().attachChild(csg);\r\n```\r\n\r\n\r\n```java\r\nMaterial mat_csg = assetManager.loadMaterial(“Materials/WallCover/BrownBricks.j3m”);\r\nmat_csg.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);\r\n\r\nCSGNode csg = new CSGNode();\r\ncsg.setMaterial(mat_csg);\r\n\r\nSpatial s = assetManager.loadModel(“Models/Characters/Goblin.j3o”);\r\n\r\nArrayList\u003cGeometry\u003e g = new ArrayList\u003c\u003e();\r\nGeometryBatchFactory.gatherGeoms(s, g);\r\nMesh m = new Mesh();\r\nGeometryBatchFactory.mergeGeometries(g, m);\r\nMeshBrush mb = new MeshBrush(m);\r\ncsg.addBrush(mb);\r\nCubeBrush base = new CubeBrush(new Vector3f(0f, 0.5f, 0f), new Vector3f(1f, 0.1f, 1f));\r\nbase.setType(BrushType.SUBTRACTIVE);\r\n\r\ncsg.addBrush(base);\r\ncsg.regenerate();\r\ncsg.move(0f, 1f, 0f);\r\n\r\nthis.app.getRootNode().attachChild(csg);\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandychase%2Ffabian-csg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandychase%2Ffabian-csg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandychase%2Ffabian-csg/lists"}