{"id":23281984,"url":"https://github.com/mcneel/threelib","last_synced_at":"2025-08-21T13:33:12.440Z","repository":{"id":25794638,"uuid":"106256731","full_name":"mcneel/ThreeLib","owner":"mcneel","description":".net Class Library for creating Three.js compatible objects","archived":false,"fork":false,"pushed_at":"2022-12-07T20:31:37.000Z","size":7018,"stargazers_count":35,"open_issues_count":9,"forks_count":11,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-12-20T00:13:13.838Z","etag":null,"topics":["csharp","threejs"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mcneel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-09T08:30:02.000Z","updated_at":"2024-08-30T11:19:30.000Z","dependencies_parsed_at":"2023-01-14T03:45:12.719Z","dependency_job_id":null,"html_url":"https://github.com/mcneel/ThreeLib","commit_stats":null,"previous_names":["mcneel/irislib"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcneel%2FThreeLib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcneel%2FThreeLib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcneel%2FThreeLib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcneel%2FThreeLib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcneel","download_url":"https://codeload.github.com/mcneel/ThreeLib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230516201,"owners_count":18238353,"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":["csharp","threejs"],"created_at":"2024-12-20T00:13:23.653Z","updated_at":"2024-12-20T00:13:24.581Z","avatar_url":"https://github.com/mcneel.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ThreeLib\n.net Class Library written in c# for creating [Three.js](https://github.com/mrdoob/three.js) compatible objects.\n\n[![Build status](https://ci.appveyor.com/api/projects/status/7bh8wx2e74b6krrd?svg=true)](https://ci.appveyor.com/project/fraguada/ThreeLib)\n\nThe scope of this project is focused on serialization (and later perhaps deserialization). Therefore the objects to be targeted should be those that can be read through one of the Three.js [Loaders](https://github.com/mrdoob/three.js/tree/master/src/loaders).\n\nThis library could be used to develop exporter plugins from 3d modelling software that support mono / .net.\n\nThis project started as project [Iris](http://mcneel.github.io/Iris/), a Three.js exporter for [Rhino3d](http://www.rhino3d.com/). ThreeLib is essentially the serialization library from that project recreated as an open source project and rewritten to be more like working with Three.js. ThreeLib is what allows Iris to write Rhino Objects to json.\n\n## Docs\n- [LICENSE](https://github.com/mcneel/ThreeLib/blob/master/LICENSE)\n- [CODE OF CONDUCT](https://github.com/mcneel/ThreeLib/blob/master/CODE_OF_CONDUCT.md)\n- [CONTRIBUTING](https://github.com/mcneel/ThreeLib/blob/master/CONTRIBUTING.md)\n\n## Dependencies\n- [Json.Net](https://github.com/JamesNK/Newtonsoft.Json)\n\n## Usage\nYou can either clone this repo and build the ThreeLib.csproj or use the published [NuGet package](https://www.nuget.org/packages/ThreeLib/).\n\nCheck out the [Sample project](https://github.com/mcneel/ThreeLib/tree/master/Sample) to see how some of the API is coming along.\n\nFor example:\n```csharp\nvar scene = new Scene\n{\n    Background = new  Color(255,0,255).ToInt(),\n    Name = \"My Scene\"\n};\n\nvar verts = new List\u003cfloat[]\u003e\n{\n    new float[] { 0, 0, 0 },\n    new float[] { 0, 0, 10.1234f },\n    new float[] { 10, 0, 10 },\n    new float[] { 10, 0, 0 }\n};\n\nvar norms = new List\u003cfloat[]\u003e\n{\n    new float[] { 0, 1, 0 },\n    new float[] { 0, 1, 0 },\n    new float[] { 0, 1, 0 },\n    new float[] { 0, 1, 0 }\n};\n\nvar vertices = Geometry.ProcessVertexArray(verts); //flattens a List\u003cfloat[]\u003e\n\nvar normals = Geometry.ProcessNormalArray(norms);\n\nvar face = new int[] { 0, 1, 2, 3 };\n\nvar faces = Geometry.ProcessFaceArray(new List\u003cint[]\u003e { { face } }, false, false);\n\nvar geometry = new Geometry(vertices, faces, normals);\n\nvar mesh = new Mesh\n{\n    Geometry = geometry,\n    Material = material,\n    Name = \"My Mesh\"\n};\n\nscene.Add(mesh);\n\nscene.ToJSON(false);\n```\n\nRsults in:\n```json\n{\n\t\"metadata\" : {\n\t\t\"version\" : 4.5,\n\t\t\"type\" : \"Object\",\n\t\t\"generator\" : \"ThreeLib-Object3D.toJSON\"\n\t},\n\t\"geometries\" : [{\n\t\t\t\"data\" : {\n\t\t\t\t\"vertices\" : [0, 0, 0, 0, 0, 10.1234, 10, 0, 10, 10, 0, 0],\n\t\t\t\t\"colors\" : [],\n\t\t\t\t\"faces\" : [33, 0, 1, 2, 3, 0, 1, 2, 3],\n\t\t\t\t\"uvs\" : [],\n\t\t\t\t\"normals\" : [0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0]\n\t\t\t},\n\t\t\t\"matrix\" : [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1],\n\t\t\t\"uuid\" : \"7989f47c-5e74-4d1b-830d-880ba402d78d\",\n\t\t\t\"type\" : \"Geometry\"\n\t\t}\n\t],\n\t\"materials\" : [{\n\t\t\t\"color\" : 16777215,\n\t\t\t\"roughness\" : 1.0,\n\t\t\t\"metalness\" : 0.25,\n\t\t\t\"opacity\" : 1.0,\n\t\t\t\"uuid\" : \"683ae9a3-608a-4982-b301-448bd8a41105\",\n\t\t\t\"type\" : \"MeshStandardMaterial\"\n\t\t}\n\t],\n\t\"object\" : {\n\t\t\"background\" : 16711935,\n\t\t\"children\" : [{\n\t\t\t\t\"geometry\" : \"7989f47c-5e74-4d1b-830d-880ba402d78d\",\n\t\t\t\t\"material\" : \"683ae9a3-608a-4982-b301-448bd8a41105\",\n\t\t\t\t\"matrix\" : [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1],\n\t\t\t\t\"uuid\" : \"d48d6259-0eb6-466e-b484-65be547b1934\",\n\t\t\t\t\"name\" : \"My Mesh\",\n\t\t\t\t\"type\" : \"Mesh\"\n\t\t\t}\n\t\t],\n\t\t\"matrix\" : [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1],\n\t\t\"uuid\" : \"da0f589a-50d3-4a65-91ed-061b28d961b5\",\n\t\t\"name\" : \"My Scene\",\n\t\t\"type\" : \"Scene\"\n\t}\n}\n```\n\n## Current Status\n\nThree.js Objects\n\n| Category\t\t\t\t| Object                     | Status |\n|:------------------\t|:---------------------------|:-------|\n|Animation\t\t\t\t| -\t\t\t\t\t\t\t | -      |\n|Animation / Tracks\t\t| -\t\t\t\t\t\t\t | -      |\n|Audio\t\t\t\t\t| -\t\t\t\t\t\t\t | -      |\n|[Cameras](https://github.com/mcneel/ThreeLib/tree/master/THREE/Cameras)\t\t| Camera\t\t\t\t\t | WIP    |\n|\t\t\t\t\t\t| CubeCamera\t\t\t\t | -      |\n|\t\t\t\t\t\t| OrthographicCamera\t\t | WIP    |\n|\t\t\t\t\t\t| PerspectiveCamera\t\t\t | WIP    |\n|\t\t\t\t\t\t| StereoCamera\t\t\t\t | -      |\n|Constants\t\t\t\t| -\t\t\t\t\t\t\t | -      |\n|[Core](https://github.com/mcneel/ThreeLib/tree/master/THREE/Core)\t\t\t| BufferAttribute\t\t\t | WIP    |\n|\t\t\t\t\t\t| BufferGeometry\t\t\t | WIP    |\n|\t\t\t\t\t\t| Clock\t\t\t\t\t\t | -      |\n|\t\t\t\t\t\t| DirectGeometry\t\t\t | -      |\n|\t\t\t\t\t\t| EventDispatcher\t\t\t | -      |\n|\t\t\t\t\t\t| Face3\t\t\t\t\t\t | -      |\n|\t\t\t\t\t\t| Geometry\t\t\t\t\t | WIP    |\n|\t\t\t\t\t\t| InstancedBufferAttribute   | -      |\n|\t\t\t\t\t\t| InstancedBufferGeometry    | -      |\n|\t\t\t\t\t\t| InstancedInterleavedBuffer | -      |\n|\t\t\t\t\t\t| InterleavedBuffer          | -      |\n|\t\t\t\t\t\t| InterleavedBufferAttribute | -      |\n|\t\t\t\t\t\t| Layers\t\t\t\t\t | -      |\n|\t\t\t\t\t\t| Object3D\t\t\t\t\t | WIP    |\n|\t\t\t\t\t\t| Raycaster\t\t\t\t\t | -      |\n|\t\t\t\t\t\t| Uniform\t\t\t\t\t | -      |\n|Core/BufferAttributes\t| -\t\t\t\t\t\t\t | -      |\n|Geometries\t\t\t\t| -\t\t\t\t\t\t\t | -      |\n|[Lights](https://github.com/mcneel/ThreeLib/tree/master/THREE/Lights)\t\t| AmbientLight\t\t\t\t | WIP    |\n|\t\t\t\t\t\t| DirectionalLight\t\t\t | WIP    |\n|\t\t\t\t\t\t| HemisphereLight\t\t\t | WIP    |\n|\t\t\t\t\t\t| Light\t\t\t\t\t\t | WIP    |\n|\t\t\t\t\t\t| PointLight\t\t\t\t | WIP    |\n|\t\t\t\t\t\t| RectAreaLight\t\t\t\t | WIP    |\n|\t\t\t\t\t\t| SpotLight\t\t\t\t\t | WIP    |\n|[Lights/Shadows](https://github.com/mcneel/ThreeLib/tree/master/THREE/Lights)\t\t| DirectionalLightShadow\t | WIP    |\n|\t\t\t\t\t\t| LightShadow\t\t\t\t | WIP    |\n|\t\t\t\t\t\t| SpotLightShadow\t\t\t | WIP    |\n|[Materials](https://github.com/mcneel/ThreeLib/tree/master/THREE/Materials)\t| LineBasicMaterial\t\t\t | WIP    |\n|\t\t\t\t\t\t| LineDashedMaterial\t\t | -      |\n|\t\t\t\t\t\t| Material\t\t\t\t\t | WIP    |\n|\t\t\t\t\t\t| MeshBasicMaterial\t\t\t | WIP    |\n|\t\t\t\t\t\t| MeshDepthMaterial\t\t\t | WIP    |\n|\t\t\t\t\t\t| MeshLambertMaterial\t\t | WIP    |\n|\t\t\t\t\t\t| MeshNormalMaterial\t\t | WIP    |\n|\t\t\t\t\t\t| MeshPhongMaterial\t\t\t | WIP    |\n|\t\t\t\t\t\t| MeshPhysicalMaterial\t\t | WIP    |\n|\t\t\t\t\t\t| MeshStandardMaterial\t\t | WIP    |\n|\t\t\t\t\t\t| MeshToonMaterial\t\t\t | -\t  |\n|\t\t\t\t\t\t| PointsMaterial\t\t\t | WIP    |\n|\t\t\t\t\t\t| RawShaderMaterial\t\t\t | -\t  |\n|\t\t\t\t\t\t| ShaderMaterial\t\t\t | -\t  |\n|\t\t\t\t\t\t| ShadowMaterial\t\t\t | -\t  |\n|\t\t\t\t\t\t| SpriteMaterial\t\t\t | -\t  |\n|[Math](https://github.com/mcneel/ThreeLib/tree/master/THREE/Math)\t\t\t| Box2\t\t\t\t\t\t | -      |\n|\t\t\t\t\t\t| Box3\t\t\t\t\t\t | -      |\n|\t\t\t\t\t\t| Color\t\t\t\t\t\t | WIP    |\n|\t\t\t\t\t\t| Cylindrical\t\t\t\t | -      |\n|\t\t\t\t\t\t| Euler\t\t\t\t\t\t | WIP    |\n|\t\t\t\t\t\t| Frustum\t\t\t\t\t | -      |\n|\t\t\t\t\t\t| Interpolant\t\t\t\t | -      |\n|\t\t\t\t\t\t| Line3\t\t\t\t\t\t | -      |\n|\t\t\t\t\t\t| Math\t\t\t\t\t\t | -      |\n|\t\t\t\t\t\t| Matrix3\t\t\t\t\t | -      |\n|\t\t\t\t\t\t| Matrix4\t\t\t\t\t | WIP    |\n|\t\t\t\t\t\t| Plane\t\t\t\t\t\t | -      |\n|\t\t\t\t\t\t| Quaternion\t\t\t\t | WIP    |\n|\t\t\t\t\t\t| Ray\t\t\t\t\t\t | -      |\n|\t\t\t\t\t\t| Sphere\t\t\t\t\t | -      |\n|\t\t\t\t\t\t| Spherical\t\t\t\t\t | -      |\n|\t\t\t\t\t\t| Triangle\t\t\t\t\t | -\t  |\n|\t\t\t\t\t\t| Vector2\t\t\t\t\t | -      |\n|\t\t\t\t\t\t| Vector3\t\t\t\t\t | WIP    |\n|\t\t\t\t\t\t| Vector4\t\t\t\t\t | -      |\n|[Objects](https://github.com/mcneel/ThreeLib/tree/master/THREE/Objects)\t\t| Bone\t\t\t\t\t\t | -      |\n|\t\t\t\t\t\t| Group\t\t\t\t\t\t | WIP    |\n|\t\t\t\t\t\t| LensFlare\t\t\t\t\t | -      |\n|\t\t\t\t\t\t| Line\t\t\t\t\t\t | WIP    |\n|\t\t\t\t\t\t| LineLoop\t\t\t\t\t | -      |\n|\t\t\t\t\t\t| LineSegments\t\t\t\t | -      |\n|\t\t\t\t\t\t| LOD\t\t\t\t\t\t | -      |\n|\t\t\t\t\t\t| Mesh\t\t\t\t\t\t | WIP    |\n|\t\t\t\t\t\t| Points\t\t\t\t\t | WIP    |\n|\t\t\t\t\t\t| Skeleton\t\t\t\t\t | -      |\n|\t\t\t\t\t\t| SkinnedMesh\t\t\t\t | -      |\n|\t\t\t\t\t\t| Sprite\t\t\t\t\t | -      |\n|[Scenes](https://github.com/mcneel/ThreeLib/tree/master/THREE/Scenes)\t\t| Fog\t\t\t\t\t\t | -      |\n|\t\t\t\t\t\t| FogExp2\t\t\t\t\t | -      |\n|\t\t\t\t\t\t| Scene\t\t\t\t\t\t | WIP    |\n|[Textures](https://github.com/mcneel/ThreeLib/tree/master/THREE/Textures)\t| CompressedTexture\t\t\t | -      |\n|\t\t\t\t\t\t| CubeTexture\t\t\t\t | -      |\n|\t\t\t\t\t\t| DataTexture\t\t\t\t | -      |\n|\t\t\t\t\t\t| DepthTexture\t\t\t\t | -      |\n|\t\t\t\t\t\t| Texture\t\t\t\t\t | WIP    |\n|\t\t\t\t\t\t| VideoTexture\t\t\t\t | -      |\n|Other\t\t\t\t\t| Image\t\t\t\t\t\t | WIP    |\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcneel%2Fthreelib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcneel%2Fthreelib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcneel%2Fthreelib/lists"}