Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: hyrodium/ElasticSurfaceEmbedding.jl
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.1.0
Choose a base ref
...
head repository: hyrodium/ElasticSurfaceEmbedding.jl
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 13 commits
  • 14 files changed
  • 3 contributors

Commits on Feb 5, 2024

  1. Bump codecov/codecov-action from 3 to 4 (#138)

    Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3 to 4.
    - [Release notes](https://github.com/codecov/codecov-action/releases)
    - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
    - [Commits](codecov/codecov-action@v3...v4)
    
    ---
    updated-dependencies:
    - dependency-name: codecov/codecov-action
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Feb 5, 2024
    Copy the full SHA
    644f316 View commit details

Commits on Apr 8, 2024

  1. Bump julia-actions/setup-julia from 1 to 2 (#139)

    Bumps [julia-actions/setup-julia](https://github.com/julia-actions/setup-julia) from 1 to 2.
    - [Release notes](https://github.com/julia-actions/setup-julia/releases)
    - [Commits](julia-actions/setup-julia@v1...v2)
    
    ---
    updated-dependencies:
    - dependency-name: julia-actions/setup-julia
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Apr 8, 2024
    Copy the full SHA
    e261f21 View commit details

Commits on Apr 17, 2024

  1. CompatHelper: bump compat for "Luxor" to "4.0" (#140)

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    github-actions[bot] authored Apr 17, 2024
    Copy the full SHA
    c341982 View commit details

Commits on Jul 7, 2024

  1. Copy the full SHA
    6769d61 View commit details
  2. Update Test.yml (#144)

    * rename CI.yml to Test.yml
    
    * add tests on v1.10 (next LTS)
    hyrodium authored Jul 7, 2024
    Copy the full SHA
    42d6839 View commit details
  3. Copy the full SHA
    4e9ecde View commit details
  4. Add more tests (#145)

    * rename `dir_result` to `DIR_RESULT`
    
    * add tests for README example
    
    * fix `show_knotvector`
    
    * add more tests
    
    * add more tests
    hyrodium authored Jul 7, 2024
    Copy the full SHA
    d1d6ee7 View commit details
  5. Copy the full SHA
    0d67ce2 View commit details
  6. add favicon (#147)

    hyrodium authored Jul 7, 2024
    Copy the full SHA
    19384f7 View commit details

Commits on Jul 8, 2024

  1. update make.jl (#148)

    hyrodium authored Jul 8, 2024
    Copy the full SHA
    a5a7367 View commit details

Commits on Sep 1, 2024

  1. Update docs (#149)

    * update readme
    
    * update install direction
    
    * update gallery
    
    * update craft.md
    hyrodium authored Sep 1, 2024
    Copy the full SHA
    ded9b6f View commit details

Commits on Dec 31, 2024

  1. CompatHelper: bump compat for "Colors" to "0.13" (#150)

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    github-actions[bot] authored Dec 31, 2024
    Copy the full SHA
    394cab7 View commit details
  2. Bump codecov/codecov-action from 4 to 5 (#151)

    * Bump codecov/codecov-action from 4 to 5
    
    Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4 to 5.
    - [Release notes](https://github.com/codecov/codecov-action/releases)
    - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
    - [Commits](codecov/codecov-action@v4...v5)
    
    ---
    updated-dependencies:
    - dependency-name: codecov/codecov-action
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    * Update .github/workflows/Test.yml
    
    ---------
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Yuto Horikawa <hyrodium@gmail.com>
    dependabot[bot] and hyrodium authored Dec 31, 2024
    Copy the full SHA
    e1c37e2 View commit details
6 changes: 5 additions & 1 deletion .github/workflows/Format.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
name: Format suggestions
on:
pull_request:
types: [ opened, reopened, synchronize, labeled, unlabeled ]
jobs:
code-style:
runs-on: ubuntu-latest
steps:
- uses: julia-actions/julia-format@v2
- uses: julia-actions/julia-format@v3
with:
version: '1'
suggestion-label: 'format-suggest'
10 changes: 6 additions & 4 deletions .github/workflows/CI.yml → .github/workflows/Test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Test
on:
push:
branches:
@@ -14,6 +14,7 @@ jobs:
matrix:
version:
- '1.6'
- '1.10'
- '1'
- 'nightly'
os:
@@ -24,7 +25,7 @@ jobs:
- x64
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
@@ -41,6 +42,7 @@ jobs:
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v5
with:
file: lcov.info
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -28,13 +28,13 @@ BasicBSpline = "0.11"
BasicBSplineExporter = "0.1"
BasicBSplineFitting = "0.1"
ColorBlendModes = "0.2"
Colors = "0.12"
Colors = "0.12, 0.13"
FastGaussQuadrature = "0.4, 0.5, 1.0"
FileIO = "1.11"
ForwardDiff = "0.10"
ImageShow = "0.3"
IntervalSets = "0.7"
Luxor = "2.17, 3.0"
Luxor = "2.17, 3.0, 4.0"
OffsetArrays = "1.10"
StaticArrays = "1.2"
julia = "^1.6"
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Elastic Surface Embedding; Weaving Parer Strips

[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://hyrodium.github.io/ElasticSurfaceEmbedding.jl/stable)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://hyrodium.github.io/ElasticSurfaceEmbedding.jl/dev)
[![Build Status](https://github.com/hyrodium/ElasticSurfaceEmbedding.jl/workflows/CI/badge.svg)](https://github.com/hyrodium/ElasticSurfaceEmbedding.jl/actions)
[![Coverage](https://codecov.io/gh/hyrodium/ElasticSurfaceEmbedding.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/hyrodium/ElasticSurfaceEmbedding.jl)
@@ -29,7 +30,7 @@ This is the meaning of "Elastic Surface Embedding".
The definition must consist of parametric mapping and its domain.
For example, a paraboloid can be parametrized as below.

$$
```math
\begin{aligned}
\boldsymbol{p}_{[0]}(u^1,u^2)
&= \begin{pmatrix}
@@ -40,16 +41,16 @@ u^2 \\
(u^1, u^2)
\in [-1,1] \times [-1,1]
\end{aligned}
$$
```

The domain will be split into $D^{(i)}$.

$$
```math
\begin{aligned}
D^{(i)}
= [-1,1] \times \left[\frac{i-1}{10}, \frac{i}{10}\right] \qquad (i = 1,...,10)
\end{aligned}
$$
```

### step 2: Numerical analysis
This is the main part.
Binary file added docs/gallery/assets/helicatenoid2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions docs/gallery/weaving_examples/helicatenoid.jl
Original file line number Diff line number Diff line change
@@ -73,3 +73,7 @@ export_pinned_steps("helicatenoid-b", steptree, unitlength=(40,"mm"), mesh=(36,1
# ![](helicatenoid-b/pinned/pinned-9.svg) ![](helicatenoid-b/pinned/pinned-18.svg) ![](helicatenoid-b/pinned/pinned-27.svg)
# ![](helicatenoid-b/pinned/pinned-36.svg) ![](helicatenoid-b/pinned/pinned-45.svg) ![](helicatenoid-b/pinned/pinned-54.svg)
# ![](helicatenoid-b/pinned/pinned-63.svg) ![](helicatenoid-b/pinned/pinned-72.svg) ![](helicatenoid-b/pinned/pinned-81.svg)

# # References
# - [Isometric transformation between a Catenoid and a Helicoid](https://www.youtube.com/watch?v=Gp6XkPLCw7s)
# - [2019 Joint Mathematics Meetings - Yuto Horikawa](https://gallery.bridgesmathart.org/exhibitions/2019-joint-mathematics-meetings/yuto-horikawa)
7 changes: 7 additions & 0 deletions docs/gallery/weaving_examples/helicatenoid2.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# ---
# title: Helicatenoid2
# cover: ../assets/helicatenoid2.jpg
# description: Weaving a transformable curved surface from catenoid to helicoid (2).
# ---

# Weaving a transformable curved surface from catenoid to helicoid.
# You can buy the kit [via my Booth site](https://hyrodium.booth.pm/items/5046306)!

# ![](../assets/helicatenoid2.jpg)

# ## Load packages
using Luxor
@@ -127,3 +131,6 @@ end
# ![](helicatenoid2/embedding-2.svg)
# ![](helicatenoid2/embedding-3.svg)
# ![](helicatenoid2/embedding-4.svg)

# # References
# - [懸垂面螺旋面製作キット](https://hackmd.io/@hyrodium/Hy4D5r633)
9 changes: 5 additions & 4 deletions docs/gallery/weaving_examples/stereographicprojection.jl
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
# ---

# A point light illuminates the grid points on the ground.
# You can buy the kit [via my Booth site](https://hyrodium.booth.pm/items/5046218)!

# ![](../assets/stereographicprojection.jpg)

@@ -130,7 +131,7 @@ end
# Please check the following references for more information.

# # References
# * [紙工作で立体射影をつくった話](https://note.com/hyrodium/n/n7b7cf03a7d91)
# * [立体射影製作キット](https://hackmd.io/@hyrodium/HJsIPNKqo)
# * [Stereographic projection weaving kit](https://hackmd.io/@hyrodium/H1epn1rRj)
# * [Further adventures in stereographic projection](https://www.youtube.com/watch?v=lbUOScpu0ws)
# - [紙工作で立体射影をつくった話](https://note.com/hyrodium/n/n7b7cf03a7d91)
# - [立体射影製作キット](https://hackmd.io/@hyrodium/HJsIPNKqo)
# - [Stereographic projection weaving kit](https://hackmd.io/@hyrodium/H1epn1rRj)
# - [Further adventures in stereographic projection](https://www.youtube.com/watch?v=lbUOScpu0ws)
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ makedocs(;
format = Documenter.HTML(;
prettyurls = true,
canonical = "https://hyrodium.github.io/ElasticSurfaceEmbedding.jl",
assets = ["assets/custom.css", gallery_assets],
assets = ["assets/favicon.ico", "assets/custom.css", gallery_assets],
repolink = "https://github.com/hyrodium/ElasticSurfaceEmbedding.jl"
),
pages = [
Binary file added docs/src/assets/favicon.ico
Binary file not shown.
11 changes: 9 additions & 2 deletions docs/src/craft.md
Original file line number Diff line number Diff line change
@@ -8,10 +8,17 @@ You can:
* I'm using [Beambox by FLUX.inc](https://flux3dp.com/beambox/).
* [Compute the shape of paper strip](@ref numerical_computation), instead of downloading the paraboloid.
* This needs setup for Julia environment.
* Buy already cut pieces of paper at [Booth](https://hyrodium.booth.pm/) (In preparation).
* Ships from Japan.
* Buy already cut pieces of paper from [my Booth page](https://hyrodium.booth.pm/).
* [懸垂面↔螺旋面 変形模型製作キット](https://hyrodium.booth.pm/items/5046306)
* [立体射影製作キット](https://hyrodium.booth.pm/items/5046218)

## Images during the making process

![](img/assembling.png)
![](img/craft.png)

See also

- [立体射影製作キット](https://hackmd.io/@hyrodium/HJsIPNKqo)
- [Stereographic projection weaving kit](https://hackmd.io/@hyrodium/H1epn1rRj)
- [懸垂面螺旋面製作キット](https://hackmd.io/@hyrodium/Hy4D5r633)
4 changes: 2 additions & 2 deletions docs/src/run-julia.md
Original file line number Diff line number Diff line change
@@ -6,8 +6,8 @@ On Julia's package mode, run the following commands.
pkg> add IntervalSets
pkg> add StaticArrays
pkg> add BasicBSpline
pkg> add https://github.com/hyrodium/BasicBSplineExporter.jl
pkg> add https://github.com/hyrodium/ElasticSurfaceEmbedding.jl
pkg> add BasicBSplineExporter.jl
pkg> add ElasticSurfaceEmbedding.jl
```

## Overview of our method
10 changes: 5 additions & 5 deletions src/_bspline.jl
Original file line number Diff line number Diff line change
@@ -95,7 +95,7 @@ function suggest_knotvector(steptree; index=0)
end

"""
show_knotvector(; index=0)
show_knotvector(::StepTree; index=0)
Show current knotvector and suggestions for knot insertions (with given index).
"""
@@ -107,10 +107,10 @@ function show_knotvector(steptree; index = 0)
k₁₊, k₂₊ = suggest_knotvector(steptree, index=index)
msg = """
Current knotvectors (k₁, k₂) and suggestions for knot insertions (k₁₊, k₂₊)
k₁: , $(BasicBSpline._vec(k₁))
k₂: , $(BasicBSpline._vec(k₂))
k₁₊: , $(BasicBSpline._vec(k₁₊))
k₂₊: , $(BasicBSpline._vec(k₂₊))
k₁: $(BasicBSpline._vec(k₁))
k₂: $(BasicBSpline._vec(k₂))
k₁₊: $(BasicBSpline._vec(k₁₊))
k₂₊: $(BasicBSpline._vec(k₂₊))
"""
@info msg
return
48 changes: 42 additions & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -31,15 +31,38 @@ function delta(f, B)
return maximum(f.(xs)) - minimum(f.(xs))
end

dir_result = joinpath(@__DIR__, "result")

rm(dir_result, recursive = true, force = true)
DIR_RESULT = joinpath(@__DIR__, "result")

rm(DIR_RESULT, recursive = true, force = true)

@testset "README example" begin
# Overload the shape definition
ElasticSurfaceEmbedding.surface(x,y) = SVector(x, y, x^2+y^2)
# (1) split the surface into strips
dom = [(-1..1, (i-1)/10..i/10) for i in 1:10]
# (2) Embed the strips onto a plane
res = auto_allsteps(dom)
export_pinned_steps(joinpath(DIR_RESULT, "paraboloid"), res)

@test isfile(joinpath(DIR_RESULT, "paraboloid", "pinned", "pinned-7.svg"))
@test isfile(joinpath(DIR_RESULT, "paraboloid", "pinned", "pinned-14.svg"))
@test isfile(joinpath(DIR_RESULT, "paraboloid", "pinned", "pinned-21.svg"))
@test isfile(joinpath(DIR_RESULT, "paraboloid", "pinned", "pinned-28.svg"))
@test isfile(joinpath(DIR_RESULT, "paraboloid", "pinned", "pinned-35.svg"))
@test isfile(joinpath(DIR_RESULT, "paraboloid", "pinned", "pinned-42.svg"))
@test isfile(joinpath(DIR_RESULT, "paraboloid", "pinned", "pinned-49.svg"))
@test isfile(joinpath(DIR_RESULT, "paraboloid", "pinned", "pinned-56.svg"))
@test isfile(joinpath(DIR_RESULT, "paraboloid", "pinned", "pinned-63.svg"))
@test isfile(joinpath(DIR_RESULT, "paraboloid", "pinned", "pinned-70.svg"))
end

@testset "Rhomboid" begin
ElasticSurfaceEmbedding.𝒑₍₀₎(u¹, u²) = SVector(u¹, u², u¹ + u²)
D = (-1.0 .. 1.0, -1.0 .. 1.0)
show_strain(D)
@test_logs (:info, "Strain - domain: [-1.0, 1.0]×[-1.0, 1.0]\nPredicted: (min: -0.0, max: 0.0)\n") show_strain(D)
@test_logs (:info, "Strain - domain: [-1.0, 1.0]×[-1.0, 1.0]\n Predicted: (min: -0.0, max: 0.0)\n") show_strain([D])
@test_logs (:info, "Strain - domain: [-1.0, 1.0]×[-1.0, 1.0]\n Predicted: (min: -0.0, max: 0.0)\nStrain - domain: [-1.0, 1.0]×[-1.0, 1.0]\n Predicted: (min: -0.0, max: 0.0)\n") show_strain([D,D])

result = initial_state(D)
M = ElasticSurfaceEmbedding.loadM(result)
@@ -57,6 +80,19 @@ rm(dir_result, recursive = true, force = true)
@test 𝒂[M, n] [(3 / 2), 1 / (2)]
@test 𝒂[M, N] [(3 / 2), 3 / (2)]

P₁, _ = result.steps[end].manifold.bsplinespaces
k₁ = knotvector(P₁)
@test k₁.vector [-1,-1,-1,-1,0,1,1,1,1]
k₁₊, _ = suggest_knotvector(result, index=1)
msg = """
Current knotvectors (k₁, k₂) and suggestions for knot insertions (k₁₊, k₂₊)
k₁: $(BasicBSpline._vec(k₁))
k₂: $([-1.0, -1.0, -1.0, 1.0, 1.0, 1.0])
k₁₊: $(BasicBSpline._vec(k₁₊))
k₂₊: $([0.0])
"""
@test_logs (:info, msg) show_knotvector(result)

newton_onestep!(result)
M = ElasticSurfaceEmbedding.loadM(result)
𝒂 = controlpoints(M)
@@ -216,12 +252,12 @@ end
pin!(result)
end

export_all_steps(joinpath(dir_result, "Paraboloid"), result)
files_pinned = readdir(joinpath(dir_result, "Paraboloid", "pinned"))
export_all_steps(joinpath(DIR_RESULT, "Paraboloid"), result)
files_pinned = readdir(joinpath(DIR_RESULT, "Paraboloid", "pinned"))

@test length(files_pinned) == N

# img_b = load(joinpath(dir_result,"Paraboloid","append","Paraboloid-5_append.png"))
# img_b = load(joinpath(DIR_RESULT,"Paraboloid","append","Paraboloid-5_append.png"))
# d = Euclidean()
# @test d(RGB.(img_a), RGB.(img_b)) < 0.0001
end