{"id":19548542,"url":"https://github.com/goswinr/euclid","last_synced_at":"2025-10-15T04:47:13.001Z","repository":{"id":65762961,"uuid":"208027353","full_name":"goswinr/Euclid","owner":"goswinr","description":"A 2D and 3D geometry library for F#","archived":false,"fork":false,"pushed_at":"2025-04-24T05:49:59.000Z","size":1263,"stargazers_count":29,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-24T06:32:25.829Z","etag":null,"topics":["2d-geometry","3d-geometry","fable","fsharp","geometry"],"latest_commit_sha":null,"homepage":"https://goswinr.github.io/Euclid/","language":"F#","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/goswinr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2019-09-12T10:41:57.000Z","updated_at":"2025-04-24T05:50:03.000Z","dependencies_parsed_at":"2024-05-02T16:55:52.983Z","dependency_job_id":"23ab4e96-0f60-4c67-8b0d-0c9b46b9dbd5","html_url":"https://github.com/goswinr/Euclid","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goswinr%2FEuclid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goswinr%2FEuclid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goswinr%2FEuclid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goswinr%2FEuclid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goswinr","download_url":"https://codeload.github.com/goswinr/Euclid/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251051273,"owners_count":21528786,"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":["2d-geometry","3d-geometry","fable","fsharp","geometry"],"created_at":"2024-11-11T03:56:09.844Z","updated_at":"2025-10-15T04:47:12.981Z","avatar_url":"https://github.com/goswinr.png","language":"F#","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Logo](https://raw.githubusercontent.com/goswinr/Euclid/main/Docs/img/logo128.png)\r\n\r\n# Euclid\r\n\r\n[![Euclid on nuget.org](https://img.shields.io/nuget/v/Euclid)](https://www.nuget.org/packages/Euclid/)\r\n[![Build Status](https://github.com/goswinr/Euclid/actions/workflows/build.yml/badge.svg)](https://github.com/goswinr/Euclid/actions/workflows/build.yml)\r\n[![Docs Build Status](https://github.com/goswinr/Euclid/actions/workflows/docs.yml/badge.svg)](https://github.com/goswinr/Euclid/actions/workflows/docs.yml)\r\n[![Test Status](https://github.com/goswinr/Euclid/actions/workflows/test.yml/badge.svg)](https://github.com/goswinr/Euclid/actions/workflows/test.yml)\r\n[![license](https://img.shields.io/github/license/goswinr/Euclid)](LICENSE.md)\r\n![code size](https://img.shields.io/github/languages/code-size/goswinr/Euclid.svg)\r\n\r\nA comprehensive 2D and 3D geometry library in F# without dependencies, designed for precision engineering and computational design.\u003cbr\u003e\r\nIt runs on JavaScript too.\r\n\r\n## Table of Contents\r\n\r\n- [Features](#features)\r\n- [Installation](#installation)\r\n- [Quick Start](#quick-start)\r\n- [Coordinate System](#coordinate-system)\r\n- [Design Philosophy](#design-philosophy)\r\n- [Usage Examples](#usage-examples)\r\n- [API Documentation](#api-documentation)\r\n- [Platform Support](#platform-support)\r\n- [Development](#development)\r\n- [Testing](#testing)\r\n- [Contributing](#contributing)\r\n- [License](#license)\r\n\r\n## Features\r\n\r\n🎯 **Core Geometry Types**\r\n- Points (`Pt`, `Pnt`), Vectors (`Vc`, `Vec`), Unit Vectors (`UnitVc`, `UnitVec`)\r\n- Lines, Planes, Boxes, Bounding Boxes, Polylines\r\n- Rotations, Quaternions, 4x4 and rigid orthonormal 4x3 matrices\r\n\r\n✨ **Key Advantages**\r\n- **Zero dependencies** - lightweight and self-contained\r\n- **Double precision** - engineered for CAD/manufacturing accuracy\r\n- **Immutable types** - functional programming friendly\r\n- **Type safety** - dedicated unit vector types prevent common errors\r\n- **Cross-platform** - compiles to .NET, JavaScript, TypeScript, Rust, Python via Fable\r\n- **Performant** - All small types are structs, functions are often inline and try to minimize the allocation of intermediate objects.\r\n\r\n🔧 **Design \u0026 Manufacturing Focus**\r\n- Optimized for design, construction, and manufacturing workflows\r\n- Integrates seamlessly with [Rhino3D](https://github.com/goswinr/Euclid.Rhino)\r\n- Right-handed coordinate system (Z-up) matching industry standards\r\n\r\n## Installation\r\n\r\nAdd Euclid to your F# project via NuGet:\r\n\r\n```bash\r\ndotnet add package Euclid\r\n```\r\n\r\nOr in F# scripting:\r\n```fsharp\r\n#r \"nuget: Euclid\"\r\n```\r\n\r\n## Quick Start\r\n\r\n```fsharp\r\nopen Euclid\r\n\r\n// Create 3D points and vectors\r\nlet point1 = Pnt(1.0, 2.0, 3.0)\r\nlet point2 = Pnt(4.0, 5.0, 6.0)\r\nlet vector = Vec(1.0, 1.0, 0.0)\r\n\r\n// Calculate distance\r\nlet distance = Pnt.distance point1 point2\r\n\r\n// Create and use unit vectors\r\nlet unitVec = vector.Unitized  // returns a UnitVec\r\n\r\n// Transform with 4x4 matrix\r\nlet matrix =\r\n    Matrix.createShear(3.0, 0, 0, 0, 0, 0)\r\n    *** // Combine transfromations\r\n    Matrix.createRotationZ 45\r\n\r\npoint1\r\n|\u003e Pnt.translate vector\r\n|\u003e Pnt.scale 3.0\r\n|\u003e Pnt.transform matrix\r\n\r\n```\r\n\r\n## Coordinate System\r\n\r\nThis library uses a **right-handed coordinate system** with the **Z-axis pointing up**.\r\n\r\n✅ **Same as in:** Rhino3D, Blender, SketchUp, Revit, AutoCAD\r\n❌ **Different from:** Unity, Unreal Engine, Maya\r\n\r\nThis choice aligns with industry-standard CAD and architectural software.\r\n\r\n## Design Philosophy\r\n\r\n### Points vs Vectors\r\n- **Points** (`Pt`, `Pnt`): Positions in space\r\n- **Vectors** (`Vc`, `Vec`): Directions and displacements\r\n\r\nWhen a 4x4 transformation matrix is applied:\r\n- **Points**: Undergo full transformation (rotation, scaling, translation)\r\n- **Vectors**: Only rotate and scale (no translation)\r\n\r\nThis follows homogeneous coordinate conventions where vectors have w=0.\r\n\r\n### Naming Conventions\r\n| Type | 2D | 3D |\r\n|------|----|----|\r\n| Point | `Pt` | `Pnt` |\r\n| Vector | `Vc` | `Vec` |\r\n| Unit Vector | `UnitVc` | `UnitVec` |\r\n\r\n### Function Patterns\r\nFunctions are available in multiple forms:\r\n```fsharp\r\n// Static module function (lowercase)\r\nlet normalized = Vec.unitized myVector\r\n\r\n// Instance method/property (uppercase)\r\nlet normalized = myVector.Unitized\r\n```\r\n\r\n## API Documentation\r\n\r\n📚 **Full API Reference:** [goswinr.github.io/Euclid](https://goswinr.github.io/Euclid/reference/euclid.html)\r\n\r\n## Platform Support\r\n\r\nThanks to [Fable](https://fable.io/), Euclid can be compiled to multiple platforms:\r\n\r\n- ✅ **.NET** (Primary target)\r\n- ✅ **JavaScript** (Browser/Node.js)\r\n- ✅ **TypeScript** (Type-safe JS)\r\n- ✅ **Rust** (Systems programming)\r\n- ✅ **Python** (Data science/ML)\r\n\r\n## Development\r\n\r\n### Building from Source\r\n```bash\r\ngit clone https://github.com/goswinr/Euclid.git\r\ncd Euclid\r\ndotnet build\r\n```\r\n\r\n### Prerequisites\r\n- .NET SDK 6.0 or later\r\n- Node.js (for JavaScript testing)\r\n\r\n## Testing\r\n\r\nTests run on both .NET and JavaScript platforms with TypeScript verification.\r\n\r\n### .NET Testing\r\n```bash\r\ncd Tests\r\ndotnet run\r\n```\r\n\r\n### JavaScript Testing\r\n```bash\r\ncd Tests\r\nnpm install\r\nnpm test\r\n```\r\n\r\nThe test suite ensures cross-platform compatibility and verifies TypeScript type definitions.\r\n\r\n## Contributing\r\n\r\nContributions are welcome!\r\n\r\n\r\n## Changelog\r\n📋 See [CHANGELOG.md](https://github.com/goswinr/Euclid/blob/main/CHANGELOG.md) for version history.\r\n\r\n## Related Projects\r\n🦏 [Euclid.Rhino](https://github.com/goswinr/Euclid.Rhino) - Rhino3D integration\r\n\r\n## License\r\n[MIT](https://github.com/goswinr/Euclid/blob/main/LICENSE.md)\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoswinr%2Feuclid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoswinr%2Feuclid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoswinr%2Feuclid/lists"}