feat: add path_geometry data
All checks were successful
Deploy to GitHub Pages / build_site (push) Successful in 2m21s

This commit is contained in:
2024-04-24 19:11:00 +02:00
parent 1df62e25e7
commit 4db1cc7d4f
75 changed files with 56957 additions and 3939 deletions

View File

@@ -1,4 +1,4 @@
use super::{create_geometry_data, wrap_geometry_data};
use super::{create_geometry_data, wrap_geometry_data, PathData};
use glam::{Mat4, Vec3};
fn create_circle(res: usize) -> Vec<f32> {
@@ -11,8 +11,8 @@ fn create_circle(res: usize) -> Vec<f32> {
circle
}
pub fn extrude_path(input_path: &[i32], res_x: usize) -> Vec<i32> {
let point_amount = input_path.len() / 4;
pub fn extrude_path(input_path: PathData, res_x: usize) -> Vec<i32> {
let point_amount = input_path.points.len() / 4;
let face_amount = (point_amount - 1) * res_x * 2;
let vertices_amount = point_amount * res_x;
@@ -26,12 +26,9 @@ pub fn extrude_path(input_path: &[i32], res_x: usize) -> Vec<i32> {
let positions = geometry.positions;
let indices = geometry.faces;
let path: &[f32];
unsafe {
path = std::slice::from_raw_parts(input_path.as_ptr() as *const f32, input_path.len());
}
let path: &[f32] = input_path.points;
for i in 0..point_amount {
for i in 0..input_path.length {
let index_offset = i * res_x * 6;
let position_offset = i * res_x;