Skip to content

Commit

Permalink
Merge branch 'master' into urdf-rs
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrixyz committed Nov 12, 2024
2 parents 968661e + 71f65fe commit 4ea8f38
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 23 deletions.
10 changes: 7 additions & 3 deletions crates/rapier3d-meshloader/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
## STL loader for the Rapier physics engine
## Mesh loader for the Rapier physics engine

Rapier is a set of 2D and 3D physics engines for games, animation, and robotics. The `rapier3d-stl`
Rapier is a set of 2D and 3D physics engines for games, animation, and robotics. The `rapier3d-meshloader`
crate lets you create a shape compatible with `rapier3d` and `parry3d` (the underlying collision-detection
library) from an STL file.
library) from different file formats, see the following features list:

- `stl`: support .stl files
- `collada`: support .dae files
- `wavefront`: support .obj files

## Resources and discussions

Expand Down
16 changes: 2 additions & 14 deletions crates/rapier3d-meshloader/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
//! ## Mesh loader for the Rapier physics engine
//!
//! Rapier is a set of 2D and 3D physics engines for games, animation, and robotics. The `rapier3d-meshloader`
//! crate lets you create a shape compatible with `rapier3d` and `parry3d` (the underlying collision-detection
//! library) from different file formats, see the following features list:
//! `stl`: support .stl files
//! `collada`: support .dae files
//! `wavefront`: support .obj files
//!
//! See documentation from [`mesh_loader`] for more details.
#![doc = include_str!("../README.md")]
#![deny(missing_docs)]

use mesh_loader::Mesh;
Expand Down Expand Up @@ -38,7 +28,7 @@ pub enum MeshLoaderError {
Io(#[from] std::io::Error),
}

/// Loads an file as shapes from a file.
/// Loads parry shapes from a file.
///
/// # Parameters
/// - `path`: the file’s path.
Expand All @@ -48,7 +38,6 @@ pub enum MeshLoaderError {
/// - `scale`: the scaling factor applied to the geometry input to the `converter`. This scale will
/// affect at the geometric level the [`LoadedShape::shape`]. Note that raw mesh value stored
/// in [`LoadedShape::raw_mesh`] remains unscaled.
// TODO: call a function for each mesh to load ? To be able to have a different mesh converter?
pub fn load_from_path(
path: impl AsRef<Path>,
converter: &MeshConverter,
Expand All @@ -59,7 +48,6 @@ pub fn load_from_path(
let scene = loader.load(path)?;
for (raw_mesh, _) in scene.meshes.into_iter().zip(scene.materials) {
let shape = load_from_raw_mesh(&raw_mesh, converter, scale);

colliders.push(match shape {
Ok((shape, pose)) => Ok(LoadedShape {
shape,
Expand Down
6 changes: 6 additions & 0 deletions crates/rapier3d-urdf/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Unreleased

<<<<<<< HEAD
### Modified

- Pre-parsing of urdf files is now done through the more recent `urdf_rs` crate.
Expand All @@ -9,6 +10,11 @@

- Add optional support for Collada and Wavefront files through new feature flags `collada` and `wavefront`.
- Add support for capsule urdf geometry
=======
### Added

- Add optional support for Collada and Wavefront files through new feature flags `collada` and `wavefront`.
>>>>>>> @{-1}
## 0.3.0

Expand Down
12 changes: 6 additions & 6 deletions src/geometry/collider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -574,15 +574,15 @@ impl ColliderBuilder {
}

/// Initialize a new collider builder with a cylindrical shape defined by its half-height
/// (along along the y axis) and its radius.
/// (along the Y axis) and its radius.
#[cfg(feature = "dim3")]
pub fn cylinder(half_height: Real, radius: Real) -> Self {
Self::new(SharedShape::cylinder(half_height, radius))
}

/// Initialize a new collider builder with a rounded cylindrical shape defined by its half-height
/// (along along the y axis), its radius, and its roundedness (the
/// radius of the sphere used for dilating the cylinder).
/// (along the Y axis), its radius, and its roundedness (the radius of the sphere used for
/// dilating the cylinder).
#[cfg(feature = "dim3")]
pub fn round_cylinder(half_height: Real, radius: Real, border_radius: Real) -> Self {
Self::new(SharedShape::round_cylinder(
Expand All @@ -593,15 +593,15 @@ impl ColliderBuilder {
}

/// Initialize a new collider builder with a cone shape defined by its half-height
/// (along along the y axis) and its basis radius.
/// (along the Y axis) and its basis radius.
#[cfg(feature = "dim3")]
pub fn cone(half_height: Real, radius: Real) -> Self {
Self::new(SharedShape::cone(half_height, radius))
}

/// Initialize a new collider builder with a rounded cone shape defined by its half-height
/// (along along the y axis), its radius, and its roundedness (the
/// radius of the sphere used for dilating the cylinder).
/// (along the Y axis), its radius, and its roundedness (the radius of the sphere used for
/// dilating the cylinder).
#[cfg(feature = "dim3")]
pub fn round_cone(half_height: Real, radius: Real, border_radius: Real) -> Self {
Self::new(SharedShape::round_cone(half_height, radius, border_radius))
Expand Down

0 comments on commit 4ea8f38

Please sign in to comment.