-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Extrudable not implemented for Polygons #15255
Copy link
Copy link
Open
Labels
A-MathFundamental domain-agnostic mathematical operationsFundamental domain-agnostic mathematical operationsC-FeatureA new feature, making something new possibleA new feature, making something new possibleD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!X-UncontroversialThis work is generally agreed uponThis work is generally agreed upon
Description
Hi,
Beginner Rust and Bevy developer here!
I don't see why RegularPolygons are extrudable and Polygons are not extrudable https://docs.rs/bevy/latest/bevy/render/mesh/trait.Extrudable.html
The code below does not work with the following error message:
the trait From<bevy::prelude::Extrusion<bevy::prelude::Polygon<_>>> is not implemented for bevy::prelude::Mesh, which is required by bevy::prelude::Extrusion<bevy::prelude::Polygon<_>>: Into<bevy::prelude::Mesh>
fn spawn_polygon(
mut commands: Commands,
mut materials: ResMut<Assets<StandardMaterial>>,
mut meshes: ResMut<Assets<Mesh>>,
) {
let points2d = vec!
[
vec2(-6., 2.),
vec2(-2., 4.),
vec2(-3., 5.)
];
let p = Polygon::new(points2d);
let e = Extrusion::new(p, 2.0);
let mesh_handle: Handle<Mesh> = meshes.add(e);
commands.spawn((
PbrBundle {
mesh: mesh_handle,
material: materials.add(StandardMaterial {
base_color: Srgba::hex("#ffd891").unwrap().into(),
..default()
}),
..default()
},
Cube,
));
}I want to be able to create custom polygons and extrude them, not sure why this is not possible at the moment?
Happy to help implement this with some guidance :)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-MathFundamental domain-agnostic mathematical operationsFundamental domain-agnostic mathematical operationsC-FeatureA new feature, making something new possibleA new feature, making something new possibleD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!X-UncontroversialThis work is generally agreed uponThis work is generally agreed upon