Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs #386

Merged
merged 3 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,26 +152,26 @@ plot(M; controlpoints=(markersize=2,))
![](docs/src/img/rational_bspline_surface_plotly.png)

### Refinement
#### h-refinement
#### h-refinement (knot insertion)
Insert additional knots to knot vectors without changing the shape.

```julia
k₊ = (KnotVector([3.1, 3.2, 3.3]), KnotVector([0.5, 0.8, 0.9])) # additional knot vectors
M_h = refinement(M, k₊) # refinement of B-spline manifold
plot(M_h; controlpoints=(markersize=2,))
```
![](docs/src/img/rational_bspline_surface_href_plotly.png)

Note that this shape and the last shape are equivalent.
#### p-refinement (degree elevation)
Increase the polynomial degrees of B-spline manifold without changing the shape.

#### p-refinement
```julia
p₊ = (Val(1), Val(2)) # additional degrees
M_p = refinement(M, p₊) # refinement of B-spline manifold
plot(M_p; controlpoints=(markersize=2,))
```
![](docs/src/img/rational_bspline_surface_pref_plotly.png)

Note that this shape and the last shape are equivalent.

### Fitting B-spline manifold
The next example shows the fitting for [the following graph on Desmos graphing calculator](https://www.desmos.com/calculator/2hm3b1fbdf)!

Expand Down
3 changes: 2 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using InteractiveUtils
using Plots
using Random

ENV["GKSwstype"] = "100"
gr()
plotly()
Random.seed!(42)
Expand All @@ -26,7 +27,7 @@ function generate_indexmd_from_readmemd()
text_index = replace(text_index, r"\$\$((.|\n)*?)\$\$" => s"```math\1```")
text_index = replace(text_index, "(https://hyrodium.github.io/BasicBSpline.jl/dev/math/bsplinebasis/#Differentiability-and-knot-duplications)" => "(@ref differentiability-and-knot-duplications)")
text_index = replace(text_index, r"https://github.com/hyrodium/BasicBSpline\.jl/assets/.*" => "![](math/differentiability.mp4)")
text_index = replace(text_index, "```julia\njulia>" => "```julia-repl\njulia>")
text_index = replace(text_index, "```julia\njulia>" => "```jldoctest\njulia>")
text_index = replace(text_index, "```julia\n" => "```@example readme\n")
text_index = replace(text_index, r"```\n!\[\]\(docs/src/img/(.*?)plotly\.png\)" => s"savefig(\"readme-\1plotly.html\") # hide\nnothing # hide\n```\n```@raw html\n<object type=\"text/html\" data=\"readme-\1plotly.html\" style=\"width:100%;height:420px;\"></object>\n```")
text_index = replace(text_index, r"```\n!\[\]\(docs/src/img/(.*?)\.png\)" => s"savefig(\"readme-\1.png\") # hide\nnothing # hide\n```\n![](readme-\1.png)")
Expand Down
8 changes: 4 additions & 4 deletions docs/src/math/refinement.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ nothing # hide

![](refinement_2dim_original.png)

### h-refinement
Insert additional knots to knot vector without changing the shape.
### h-refinement (knot insertion)
Insert additional knots to knot vectors without changing the shape.

```@repl math_refinement
k₊ = (KnotVector([3.3,4.2]), KnotVector([3.8,3.2,5.3])) # additional knot vectors
Expand All @@ -40,8 +40,8 @@ nothing # hide

![](refinement_2dim_h.png)

### p-refinement
Increase the polynomial degree of B-spline manifold without changing the shape.
### p-refinement (degree elevation)
Increase the polynomial degrees of B-spline manifold without changing the shape.

```@repl math_refinement
p₊ = (Val(1), Val(2)) # additional degrees
Expand Down
Loading