Skip to content

hyrodium/BasicBSplineExporter.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BasicBSplineExporter

Stable Dev Build Status Coverage Aqua QA

This package supports export BasicBSpline.BSplineManifold{Dim,Deg,<:StaticVector} to:

  • PNG image (.png)
  • SVG image (.png)
  • POV-Ray mesh (.inc)

Installation

] add BasicBSpline
] add https://github.com/hyrodium/BasicBSplineExporter.jl

First example

using BasicBSpline
using BasicBSplineExporter
using StaticArrays

p = 2
k = KnotVector(1:8)
P = BSplineSpace{p}(k)
rand_a = [rand(2) for i in 1:dim(P), j in 1:dim(P)]
a = [SVector(2*i-6.5, 2*j-6.5) for i in 1:dim(P), j in 1:dim(P)] + rand_a
M = BSplineManifold(a, (P,P))
k₊=(KnotVector(3.3,4.2),KnotVector(3.8,3.2,5.3))
M′ = refinement(M, k₊)
save_png("2dim.png", M)
save_png("2dim_refinement.png", M′)

Other examples

Here are some images rendared with POV-Ray.

See test/runtests.jl for more examples.