{"id":15641835,"url":"https://github.com/mattatz/curvo","last_synced_at":"2025-05-16T12:12:32.192Z","repository":{"id":234216972,"uuid":"788467963","full_name":"mattatz/curvo","owner":"mattatz","description":"NURBS curve / surface modeling library for Rust.","archived":false,"fork":false,"pushed_at":"2025-03-26T08:48:25.000Z","size":882,"stargazers_count":116,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T10:58:29.966Z","etag":null,"topics":["3d","computer-graphics","curve","modeling","nurbs","rust","surface"],"latest_commit_sha":null,"homepage":"","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/mattatz.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-04-18T13:26:17.000Z","updated_at":"2025-04-08T04:16:33.000Z","dependencies_parsed_at":"2024-05-13T03:30:47.772Z","dependency_job_id":"3b037a1b-c329-46e0-adc3-bee690b4ba7c","html_url":"https://github.com/mattatz/curvo","commit_stats":{"total_commits":267,"total_committers":2,"mean_commits":133.5,"dds":"0.0074906367041198685","last_synced_commit":"7fdcbc14bc2792e8a3d5381c7dd47da75ca6c972"},"previous_names":["mattatz/curvo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattatz%2Fcurvo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattatz%2Fcurvo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattatz%2Fcurvo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattatz%2Fcurvo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattatz","download_url":"https://codeload.github.com/mattatz/curvo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254527099,"owners_count":22085919,"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","computer-graphics","curve","modeling","nurbs","rust","surface"],"created_at":"2024-10-03T11:46:15.316Z","updated_at":"2025-05-16T12:12:32.147Z","avatar_url":"https://github.com/mattatz.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Curvo\n\n[![License](https://img.shields.io/badge/license-MIT%2FApache-blue.svg)](https://github.com/mattatz/curvo#license)\n[![Crates.io](https://img.shields.io/crates/v/curvo.svg)](https://crates.io/crates/curvo)\n[![Docs](https://docs.rs/curvo/badge.svg)](https://docs.rs/curvo/latest/curvo/)\n[![Test](https://github.com/mattatz/curvo/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/mattatz/curvo/actions/workflows/test.yml)\n\nCurvo is a NURBS curve / surface modeling library for Rust.\n\n![Visualization on bevy](https://github.com/mattatz/curvo/assets/1085910/50b44a8c-d8c1-43e0-8db5-d6fff52300e6)\n*Visualization on [Bevy](https://bevyengine.org/)*\n\nThis library enables not only the creation of NURBS curves from control points, knot vectors, and weights associated with each control point, but also supports generating curves that precisely pass through the given control points and creating periodic curves. Additionally, it allows for the construction of NURBS surfaces through operations such as _extruding_ and _lofting_ based on NURBS curves as inputs.\n\nThe modeling operations for NURBS surfaces supported by this library currently include the following:\n- Extrude\n- Loft\n- Sweep\n- Revolve\n\n\u003cimg src=\"https://github.com/mattatz/curvo/assets/1085910/1eecea06-5848-48f3-9b7d-916715082f09\" width=\"360px\" alt=\"Sweep the profile curve along the rail curve to create a surface\" /\u003e\n\n\u003cimg width=\"360px\" alt=\"Revolve the profile curve around an z-axis by PI radians to create a NURBS surface\" src=\"https://github.com/mattatz/curvo/assets/1085910/3456dc46-9977-446e-8d5c-eafe109093a7\"\u003e\n\nThe supported features also include finding the closest point on NURBS curves, finding intersections between two NURBS curves, and dividing based on arc length.\n\n\u003cimg src=\"https://github.com/mattatz/curvo/assets/1085910/f07cf1c4-3994-44d1-95a6-86a8feaf3d2e\" width=\"360px\" alt=\"Find closest point on the NURBS curve\" /\u003e\n\n\u003cimg src=\"https://github.com/mattatz/curvo/assets/1085910/dd453a50-46ca-4279-b547-c1a667d885a9\" width=\"360px\" alt=\"Divide the NURBS curve based on arc length\" /\u003e\n\n\u003cimg src=\"https://github.com/mattatz/curvo/assets/1085910/8f29cb4b-d3d5-4553-9f41-deb8cc63b132\" width=\"360px\" alt=\"Find intersection points between two NURBS curves\" /\u003e\n\n## Additional features\n\n\u003cimg src=\"https://github.com/user-attachments/assets/a4cef924-b3a9-410d-aebc-477f6f86f193\" width=\"360px\" alt=\"Boolean operations between NURBS curves\" /\u003e\n\n\u003cimg src=\"https://github.com/mattatz/curvo/assets/1085910/754d2a96-0f6b-40f7-b6b1-106789d585b7\" width=\"360px\" alt=\"Smooth periodic points interpolation with knot styles\" /\u003e\n\n\u003cimg src=\"https://github.com/mattatz/curvo/assets/1085910/87ebdb66-f0df-46cc-8cb4-01f597080ffb\" width=\"360px\" alt=\"Ellipse arc generation\" /\u003e\n\n\u003cimg src=\"https://github.com/mattatz/curvo/assets/1085910/55f214ec-668a-4d18-8fa8-bfa5ca23b3a2\" width=\"360px\" alt=\"Iso-curves on a surface\" /\u003e\n\n\u003cimg src=\"https://github.com/user-attachments/assets/3b739a9f-531c-4264-90ce-a65e426439b3\" width=\"360px\" alt=\"Closest point on a surface\" /\u003e\n\n\u003cimg src=\"https://github.com/user-attachments/assets/6dc44288-1b21-4040-a49c-fc41d4ca3f45\" width=\"360px\" alt=\"Split a surface\" /\u003e\n\n\u003cimg src=\"https://github.com/user-attachments/assets/4117250d-582e-4bee-84b7-976f27739f9d\" width=\"360px\" alt=\"Surface \u0026 curve intersections\" /\u003e\n\n\u003cimg src=\"https://github.com/user-attachments/assets/904c1a97-9f14-4bb6-9e41-6beebd62882f\" width=\"360px\" alt=\"Trimmed surface\" /\u003e\n\n## Usage\n\n```rust\nuse curvo::prelude::*;\nuse nalgebra::{Point3, Rotation3, Translation3, Vector3};\nuse std::f64::consts::FRAC_PI_2;\n\nfn main() {\n  // Create a set of points to interpolate\n  let points = vec![\n      Point3::new(-1.0, -1.0, 0.),\n      Point3::new(1.0, -1.0, 0.),\n      Point3::new(1.0, 1.0, 0.),\n      Point3::new(-1.0, 1.0, 0.),\n      Point3::new(-1.0, 2.0, 0.),\n      Point3::new(1.0, 2.5, 0.),\n  ];\n\n  // Create a NURBS curve that interpolates the given points with degree 3\n  // You can also specify the precision of the curve by generic type (f32 or f64)\n  let interpolated = NurbsCurve3D::\u003cf64\u003e::try_interpolate(\u0026points, 3).unwrap();\n\n  // NURBS curve \u0026 surface can be transformed by nalgebra's matrix\n  let rotation = Rotation3::from_axis_angle(\u0026Vector3::z_axis(), FRAC_PI_2);\n  let translation = Translation3::new(0., 0., 3.);\n  let transform_matrix = translation * rotation; // nalgebra::Isometry3\n\n  // Transform the curve by the given matrix (nalgebra::Isometry3 into nalgebra::Matrix4)\n  let offsetted = interpolated.transformed(\u0026transform_matrix.into());\n\n  // Create a NURBS surface by lofting two NURBS curves\n  let lofted = NurbsSurface::try_loft(\n    \u0026[interpolated, offsetted],\n    Some(3), // degree of v direction\n  ).unwrap();\n\n  // Tessellate the surface in adaptive manner about curvature for efficient rendering\n  let option = AdaptiveTessellationOptions {\n      norm_tolerance: 1e-4,\n      ..Default::default()\n  };\n  let tessellation = lofted.tessellate(Some(option));\n}\n\n```\n\n## Dependencies\n\n- [nalgebra](https://crates.io/crates/nalgebra): this library heavily relies on nalgebra, a linear algebra library, to perform its computations.\n\n## References\n\n- [The NURBS Book](https://www.amazon.com/NURBS-Book-Monographs-Visual-Communication/dp/3540615458) by Piegl and Tiller\n\n## Feature development sponsored by VUILD Inc.\n\nThe **NURBS boolean operations** feature in this project was developed at the request of [VUILD](https://vuild.co.jp/).  \nThey supported the development as a sponsor by funding the feature's implementation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattatz%2Fcurvo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattatz%2Fcurvo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattatz%2Fcurvo/lists"}