nicklockwood / Euclid

A Swift library for creating and manipulating 3D geometry
MIT License
644 stars 53 forks source link

Cube - width, height and lenght #63

Closed Heinevolder closed 3 years ago

Heinevolder commented 3 years ago

Hi!

Thanks for a wonderful library

I'm having some trouble creating a cuboid with a specified width, depth, and height. In the readme, you mention that it should be possible to generate a cuboid with different values for width, height, and/or depth.

am I missing how this is done?

Thanks again!

nicklockwood commented 3 years ago

@Heinevolder

let width = 1.0, height = 2.0, depth = 3.0
let cube  = Mesh.cube(size: Vector(width, height, depth))
Heinevolder commented 3 years ago

Oh - my bad!

IDE didn't show the initializer with size as a vector for some reason.

nicklockwood commented 3 years ago

@Heinevolder it's overloaded with another version that takes a Double for size, so that's probably why.