# \[ANN\] ParametricBodies.jl

**URL:** https://discourse.julialang.org/t/ann-parametricbodies-jl/117791
**Category:** Package Announcements
**Tags:** announcement, geometry
**Created:** [August 3, 2024, 8:26pm UTC](https://discourse.julialang.org/t/ann-parametricbodies-jl/117791 "2024-08-03T20:26:33Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![weymouth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/weymouth/32/15839_2.png) [@weymouth](https://discourse.julialang.org/u/weymouth)
#### Post date: [August 3, 2024, 8:26pm UTC](https://discourse.julialang.org/t/ann-parametricbodies-jl/117791/1 "2024-08-03T20:26:33Z")

</div>

Happy to announce that we’ve updated and registered [ParametricBodies.jl](https://github.com/WaterLily-jl/ParametricBodies.jl) which lets you quickly define 2D and 3D bodies based on any parametrically defined curve. We designed these for use in WaterLily simulations, but the package is purely geometric, generating signed distance functions and corresponding normals and velocities, so perhaps others will find it useful as well.

Here’s a quick example

```Julia
function whale(s) # adjustable sweep angle
    pnts = SA{Float32}[0 40 190 200 190 170 100 0 -10 0
                       0 0 8s 8s+40 5s+70 5s+50 5s+70 100 80 0]
    planform = BSplineCurve(reverse(pnts),degree=3)
    return PlanarBody(planform)
end

# defined a query point and time
x,t = SA[10,20,0],0; 
# get signed distance, normal, and velocity closest to x,t
measure(whale(10),x,t) 

```

This is an updated example from the [WaterLily preprint](https://physics.paperswithcode.com/paper/waterlily-jl-a-differentiable-and-backend) we submitted last month.
