{"id":24072931,"url":"https://github.com/markusmoenig/forgedthoughts","last_synced_at":"2025-04-28T15:32:28.822Z","repository":{"id":72892065,"uuid":"604059327","full_name":"markusmoenig/ForgedThoughts","owner":"markusmoenig","description":"A 3D modeling and rendering programming language utilizing SDFs.","archived":false,"fork":false,"pushed_at":"2024-07-11T02:56:38.000Z","size":32253,"stargazers_count":58,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-30T10:51:10.943Z","etag":null,"topics":["3d","modeling","programming-language","rendering","sdf"],"latest_commit_sha":null,"homepage":"https://forgedthoughts.com","language":"Rust","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/markusmoenig.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"markusmoenig"}},"created_at":"2023-02-20T08:48:53.000Z","updated_at":"2025-03-25T18:34:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"ae7b5cd5-a8d4-4c90-a93f-d7b5858dec68","html_url":"https://github.com/markusmoenig/ForgedThoughts","commit_stats":{"total_commits":67,"total_committers":1,"mean_commits":67.0,"dds":0.0,"last_synced_commit":"4a7b773f33520f9ec076c9e82b1cbff8232f1776"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusmoenig%2FForgedThoughts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusmoenig%2FForgedThoughts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusmoenig%2FForgedThoughts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusmoenig%2FForgedThoughts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markusmoenig","download_url":"https://codeload.github.com/markusmoenig/ForgedThoughts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251338859,"owners_count":21573627,"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":["3d","modeling","programming-language","rendering","sdf"],"created_at":"2025-01-09T17:23:41.689Z","updated_at":"2025-04-28T15:32:28.795Z","avatar_url":"https://github.com/markusmoenig.png","language":"Rust","funding_links":["https://github.com/sponsors/markusmoenig"],"categories":[],"sub_categories":[],"readme":"\nForged Thoughts is a modeling and rendering programming language. It is open source under the MIT license and currently in early development. The language utilizes 3D and 2D SDFs and is written in Rust and can be easily installed as a Rust subcommand.\n\nFor documentation and examples see the [Website](https://forgedthoughts.com).\n\nForged Thoughts strives to create high-quality distance field models for rendering and poligonization. It utilizes multi-threaded CPU based rendering in 64-bit to prevent the limitations of SDFs on the GPU. The focus is on quality, rather than speed.\n\n## Features\n\n* Easy to use programming language with special modeling functionality.\n* Inbuild renderer for Phong, PBR and a full featured BSDF pathtracer.\n* Polygonization of models (OBJ).\n* 64-bit heavily multi-threaded ray-marcher running on the CPU.\n* Access to all SDF modeling primitives, modifiers and tricks (In progress).\n\n## Goals\n\nThe overall project goals are:\n\n* Create signed distance fields for rendering and poligonization.\n* Focus is on quality rather than speed (although all example render in just a few hundred ms on my machine).\n* CPU based rather than GPU based. All computation is done in 64-bit.\n* Provide an easy but powerful syntax to model and render SDFs without any limitations.\n* Animation( TODO)\n* Object hierarchies by including sub-class scripts (TODO)\n* Share objects and materials via an integrated database (TODO)\n* Model and work with 2D SDFs and Text as an overlay to the 3D layer (TODO)\n* Terrain (TODO)\n* Physics (TODO)\n\n## Example\n\n#### Wine Glass\n\n![Wine Glass](examples/wine_glass.png)\n\nThe modeling of the glass, except the materials, is just 9 lines.\n\n```rust\n// Glass\n\nlet glass = Cone(0.6, 0.7, 0.6);\nglass.rounding = 0.2;\n\nglass.material.rgb = F3(1.0, 1.0, 1.0);\nglass.material.roughness = 0.0;\nglass.material.transmission = 1.0;\nglass.material.ior = 1.50;\n\nlet interior = glass.copy();\ninterior.scale = 0.96;\n\n// Fluid\n\nlet fluid = interior.copy();\nfluid.material.rgb = F3(\"722F37\").to_linear();\nfluid.material.transmission = 1.0;\nfluid.material.roughness = 0.5;\nfluid.material.ior = 1.3443705; // Red Wine\nfluid.material.clearcoat_gloss = 1.0;\nfluid.material.sheen = 1.0;\nfluid.material.sheen_tint = 1.0;\nfluid.max.y = 0.0;\n\nglass -= interior;\n\n// Top: Smooth Cut Off \u0026 Gold Rim\n\nlet box = Box();\nbox.material.rgb = F3(\"d4af37\");\nbox.material.metallic = 1.0;\nbox.material.roughness = 0.2;\nbox.position.y = 1.5;\n\n// Smoothly subtract the box from the glass\nglass -= Smooth(box, 0.01);\n\n// Create a groove with the gold material of the box\nglass += Groove(box, 0.001, 0.07);\n```\n\n#### Helmet\n\n![Helmet](examples/helmet.png)\n\nThe above helmet was created with the following code:\n\n```rust\n// Main shape - We make a smooth blend between a sphere and a cone\n\nlet sphere = Sphere(0.24);\nlet cone = Cone(0.3, 0.25, 0.0);\n\nlet helmet = smin(sphere, cone, 0.5);\n\n// Assign the material\n\nhelmet.material.rgb = F3(\"9F6F4A\");\nhelmet.material.metallic = 0.7;\nhelmet.material.roughness = 0.3;\n\n// Make it hollow by creating a copy, subtract it and move it down a bit\n// to open the bottom\n\nlet cut_out = helmet.copy();\ncut_out.position.y -= 0.04;\ncut_out.scale = 0.98;\nhelmet -= cut_out;\n\n// Eye holes - We mirror an Ellipsoid on the x-axis and subtract it.\n\nlet eyes = Ellipsoid();\neyes.size = F3(0.11, 0.03, 0.1);\neyes.position = F3(0.06, -0.03, 0.3);\neyes.mirror.x = true;\nhelmet -= eyes;\n\n// Nose and mouth - We modify a box and subtract it.\n\nlet cut = Box(F3(0.07, 0.2, 0.1));\ncut.position.y -= 0.25;\ncut.position.z = 0.2;\n\nlet modifier = RayModifier(\"x\", \"*\", \"sin\", \"y\");\nmodifier.frequency = 10.0;\nmodifier.amplitude = 0.7;\nmodifier.addend = 1.0;\ncut.modifier = modifier;\nhelmet -= cut;\n\n// Stripe - We add a positive groove in the intersection between\n// the helmet and a box.\n\nlet stripe = Box(F3(0.011, 0.17, 0.2));\nstripe.position.y = 0.16;\nstripe.position.z = 0.2;\nhelmet += Groove(stripe, 0.01, 0.02);\n```\n\n## Current 3D SDF Primitives\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e \u003cimg src=\"examples/primitives/sphere.png\"  alt=\"Sphere\" width = 400px height = 300px \u003e\u003c/td\u003e\n    \u003ctd\u003e \u003cimg src=\"examples/primitives/box.png\"  alt=\"Box\" width = 400px height = 300px \u003e\u003c/td\u003e\n   \u003c/tr\u003e\n   \u003ctr\u003e\n    \u003ctd\u003e \u003cimg src=\"examples/primitives/cone.png\"  alt=\"Cone\" width = 400px height = 300px \u003e\u003c/td\u003e\n    \u003ctd\u003e \u003cimg src=\"examples/primitives/ellipsoid.png\"  alt=\"Ellipsoid\" width = 400px height = 300px \u003e\u003c/td\u003e\n  \u003c/tr\u003e\n   \u003ctr\u003e\n    \u003ctd\u003e \u003cimg src=\"examples/primitives/torus.png\"  alt=\"Torus\" width = 400px height = 300px \u003e\u003c/td\u003e\n    \u003ctd\u003e \u003cimg src=\"examples/primitives/cylinder.png\"  alt=\"Cylinder\" width = 400px height = 300px \u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Current Booleans\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e \u003cimg src=\"examples/booleans/addition.png\"  alt=\"Sphere\" width = 400px height = 300px \u003e\u003c/td\u003e\n    \u003ctd\u003e \u003cimg src=\"examples/booleans/addition_smooth.png\"  alt=\"Box\" width = 400px height = 300px \u003e\u003c/td\u003e\n   \u003c/tr\u003e\n   \u003ctr\u003e\n    \u003ctd\u003e \u003cimg src=\"examples/booleans/addition_groove.png\"  alt=\"Box\" width = 400px height = 300px \u003e\u003c/td\u003e\n    \u003ctd\u003e \u003cimg src=\"examples/booleans/subtraction.png\"  alt=\"Ellipsoid\" width = 400px height = 300px \u003e\u003c/td\u003e\n  \u003c/tr\u003e\n    \u003ctd\u003e \u003cimg src=\"examples/booleans/subtraction_smooth.png\"  alt=\"Cone\" width = 400px height = 300px \u003e\u003c/td\u003e\n    \u003ctd\u003e \u003cimg src=\"examples/booleans/subtraction_groove.png\"  alt=\"Box\" width = 400px height = 300px \u003e\u003c/td\u003e\n   \u003c/tr\u003e\n  \u003c/tr\u003e\n    \u003ctd\u003e \u003cimg src=\"examples/booleans/intersection.png\"  alt=\"Cone\" width = 400px height = 300px \u003e\u003c/td\u003e\n    \u003ctd\u003e \u003cimg src=\"examples/booleans/intersection_smooth.png\"  alt=\"Box\" width = 400px height = 300px \u003e\u003c/td\u003e\n   \u003c/tr\u003e\n\u003c/table\u003e\n\n## Current Merging Functions\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e \u003cimg src=\"examples/merging/smin.png\"  alt=\"Smin\" width = 400px height = 300px \u003e\u003c/td\u003e\n   \u003c/tr\u003e\n\u003c/table\u003e\n\n## Current Modifier\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e \u003cimg src=\"examples/modifier/twist.png\"  alt=\"Sphere\" width = 400px height = 300px \u003e\u003c/td\u003e\n    \u003ctd\u003e \u003cimg src=\"examples/modifier/mirror.png\"  alt=\"Box\" width = 400px height = 300px \u003e\u003c/td\u003e\n   \u003c/tr\u003e\n    \u003ctd\u003e \u003cimg src=\"examples/modifier/max.png\"  alt=\"Max\" width = 400px height = 300px \u003e\u003c/td\u003e\n    \u003ctd\u003e \u003cimg src=\"examples/modifier/onion.png\"  alt=\"Onion\" width = 400px height = 300px \u003e\u003c/td\u003e\n   \u003c/tr\u003e\n\u003c/table\u003e\n\n## Supporting Forged Thoughts\n\nYou can support the Forged Thoughts project by becoming a [GitHub Sponsor](https://github.com/sponsors/markusmoenig).\n\n## License\n\nForged Thoughts is licensed under the MIT.\n\nUnless explicitly stated otherwise, any contribution intentionally submitted for inclusion in Forged Thoughts, shall be MIT licensed as above, without any additional terms or conditions.\n\n## Sponsors\n\nNone yet\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkusmoenig%2Fforgedthoughts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkusmoenig%2Fforgedthoughts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkusmoenig%2Fforgedthoughts/lists"}