Skip to content

Commit

Permalink
Adapt to OCADml (v0.5.0) triangular Mesh update
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffder committed Apr 20, 2023
1 parent 7dae78e commit 76d5525
Show file tree
Hide file tree
Showing 39 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v0.2.2

- adapt to OCADml Mesh breaking change (polygonal -> triangular)

## v0.2.1

- make odoc manual compatible with odig
Expand Down
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@
(cairo2
(>= 0.6.2))
(OCADml
(>= 0.4.0))))
(>= 0.5.0))))
Binary file modified examples/pngs/arc_points_2d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/pngs/arc_points_3d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/pngs/arc_wedge_2d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/pngs/axial_chalice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/pngs/bezier_spline_path.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/pngs/cartesian_gravity_well.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/pngs/chamfered_loop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/pngs/chamfered_square_with_holes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/pngs/circular_rounding.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/pngs/eased_morph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/pngs/elbow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/pngs/helix_extrude.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/pngs/helix_path_points.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/pngs/incl_eased_morph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/pngs/incl_polar_rose.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/pngs/offset_poly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/pngs/polar_rose.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/pngs/polyholes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/pngs/resampled_path.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/pngs/rounded_polyhole_sweep.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/pngs/rounded_prism_star.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/pngs/rounded_prism_tunnel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/pngs/rounded_text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/pngs/scaling_twister_extrude.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/pngs/spiral.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/pngs/spline.png
Binary file modified examples/pngs/sweep_path_default.png
Binary file modified examples/pngs/sweep_path_euler.png
Binary file modified examples/pngs/sweep_starburst_default.png
Binary file modified examples/pngs/sweep_starburst_euler.png
Binary file modified examples/pngs/tangent_morph_sweep.png
Binary file modified examples/pngs/tangent_skin_test.png
Binary file modified examples/pngs/test_hull_3d.png
Binary file modified examples/pngs/vaccum_connector.png
Binary file modified examples/pngs/vaccum_connector_points.png
Binary file modified examples/pngs/wave_cylinder.png
7 changes: 5 additions & 2 deletions lib/scad.ml
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,10 @@ let of_poly2 ?convexity poly =
in
polygon ?convexity ~paths:(List.rev paths) (List.rev points)

let of_mesh ?convexity m = polyhedron ?convexity (Mesh.points m) (Mesh.faces m)
let of_mesh ?convexity m =
let faces = List.map (fun (a, b, c) -> [ a; b; c ]) (Mesh.faces m) in
polyhedron ?convexity (Mesh.points m) faces

let[@inline] of_poly3 ?convexity t = of_mesh ?convexity @@ Mesh.of_poly3 t

let to_string t =
Expand Down Expand Up @@ -425,7 +428,7 @@ let to_string t =
indent
(Buffer.contents @@ buf_of_list buf_add_vec2 points)
( Option.map (fun ps -> Buffer.contents @@ buf_of_list buf_add_idxs ps) paths
|> maybe_fmt ", paths=%s" )
|> maybe_fmt ", paths=%s" )
convexity
| Text { text; size; font; halign; valign; spacing; direction; language; script; fn }
->
Expand Down

0 comments on commit 76d5525

Please sign in to comment.