tataratat / splinepy

Library for prototyping spline geometries of arbitrary dimensions and degrees, and IGA
https://tataratat.github.io/splinepy
Other
45 stars 13 forks source link

Ft extract basis #407

Closed j042 closed 5 months ago

j042 commented 5 months ago

Overview

Visualizing basis is easier now. spline.extract.bases() will create a spline that represents the basis function. This isn't the most efficient way, but fits right into our current visualization and helpers pipeline. Some sort of automatic random coloring could be a nice add-on.

Addressed issues

Showcase

A short / one-liner example to highlight the (new) feature

bases = spline.extract.bases()
spp.show(bases)

support123 = spline.extract.bases([1, 2, 3])
spp.show(support123)
1d 2d

Checklists

jzwar commented 5 months ago

Unrelated: we should bump version soon

j042 commented 5 months ago

Nice idea! You could just add a line with show_options["c"]=i to automatically display in different colors.

The spline extraction also works for rationals so unless you don't want to use meshes or matplotlib, this is a pretty efficient way to visualize actually...

AND many thanks to svg export, we can export smooth bases, smooth!

good call with "c"=i

j042 commented 5 months ago

Unrelated: we should bump version soon

yes, was waiting to finish a few things to bump it to 0.1, but I think it's better to bump one with this or something.

Also wanna add a test for this. Maybe will add directly to pytest PR

j042 commented 5 months ago

@jzwar

e1 e2