Skip to content

Commit 74ef2fa

Browse files
authored
Merge pull request #66 from jabelic/rls/ready-to-release-01
Rls/ready to release 01
2 parents 2115107 + 670da54 commit 74ef2fa

10 files changed

Lines changed: 210 additions & 256 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
- master
66
- staging
77
- release
8-
tags: '*'
8+
tags: "*"
99
pull_request:
1010
concurrency:
1111
# Skip intermediate builds: always.
@@ -20,8 +20,7 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
version:
23-
- '1.5'
24-
# - 'nightly'
23+
- "1.5"
2524
os:
2625
- ubuntu-latest
2726
arch:
@@ -38,4 +37,4 @@ jobs:
3837
- uses: julia-actions/julia-processcoverage@v1
3938
- uses: codecov/codecov-action@v2
4039
with:
41-
files: lcov.info
40+
files: lcov.info

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ painting-board*
88
*.jl.*.cov
99
*.jl.cov
1010
*.jl.mem
11-
/Manifest.toml
11+
/Manifest.toml

README.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# SignedDistanceFunction.jl
22

33
<!-- [![Build Status](https://app.travis-ci.com/jabelic/SignedDistanceFunction.jl.svg?branch=release)](https://app.travis-ci.com/jabelic/SignedDistanceFunction.jl) -->
4+
45
[![CI](https://github.com/jabelic/SignedDistanceFunction.jl/actions/workflows/ci.yml/badge.svg)](https://github.com/jabelic/SignedDistanceFunction.jl/actions/workflows/ci.yml)
56
[![Coverage](https://codecov.io/gh/jabelic/SignedDistanceFunction.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/jabelic/SignedDistanceFunction.jl)
67
[![Coverage](https://coveralls.io/repos/github/jabelic/SignedDistanceFunction.jl/badge.svg?branch=release)](https://coveralls.io/github/jabelic/SignedDistanceFunction.jl?branch=main)
78

8-
99
SignedDistanceFunction.jl is a package to compute signed distance function.
1010

1111
Main features are:
@@ -31,10 +31,6 @@ The closed curve data must be `.csv` file. N is an `Int`, representing the numbe
3131

3232
#### macOS
3333

34-
`$ make initial`
35-
36-
or
37-
3834
`$ julia>`
3935
`$ Pkg(1.5)> add PackageCompiler`
4036
`$ Pkg(1.5)> add DelimitedFiles`
@@ -47,8 +43,7 @@ or
4743
`$ (SignedDistanceFunction)>`
4844
`$ julia> using SignedDistanceFunction`
4945
`$ julia> signedDistance2D("xxxxxx.csv", N)`
50-
51-
46+
`$ echo "Sysimage.so" >> .gitignore`
5247

5348
### Debug in REPL
5449

@@ -70,12 +65,12 @@ return the REPL(`Delete/Backspace`)
7065

7166
`julia> signedDistance2D("XXXXXX.csv", N)`
7267

73-
<!-- Plots sample data:
68+
<!-- Plots sample data:
7469
7570
`julia> using CSV, DataFrames, Plots, DelimitedFiles, Luxor, BenchmarkTools`
7671
7772
`julia> gamma = readdlm("data.csv", ',', Float64)`
7873
79-
`julia> plot(gamma[:, 1], gamma[:, 2], st=:scatter, title="infty_shape", markersize=2, grid=false)`
74+
`julia> plot(gamma[:, 1], gamma[:, 2], st=:scatter, title="infty_shape", markersize=2, grid=false)`
8075
8176
`julia> savefig("interface.png") -->

benchmarks/benchmarks.jl

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import .Draw: parformance_graphs
1111
function _exe(kinds)
1212
_execute_times = 2
1313
_phi = []
14+
# NOTE: N is for image size(N x N)
1415
init_N = 100
1516
increment_N = 200
1617
runtime = zeros(_execute_times + 1, 2)
@@ -40,38 +41,3 @@ end
4041
# _exe(2)
4142
_exe(3)
4243

43-
#==
44-
Jabelic test it and get it as below.
45-
46-
N2300: 300+200i, ARG = 10
47-
[300, 500, 700, 900, 1100, 1300, 1500, 1700, 1900, 2100, 2300]
48-
[2.727736517 1.549037993; 2.430711433 4.540753791;
49-
4.87217261 8.72733049; 6.970006918 11.296165896;
50-
10.919117877 16.429877231; 15.524662846 28.576650596;
51-
20.630861499 38.540759007; 26.182433943 51.252256581;
52-
33.966169503 64.128344396; 40.489381557 75.419365612;
53-
50.053971199 91.594363467]
54-
55-
300+200i, ARG = 3, interface multi-thread, single-thread
56-
[2.402844242 1.564786665; 2.415855251 4.372297246; 4.636160664 9.164722692; 7.243630318 11.635953353]
57-
signedDistance2D, 300+200i, ARG = 3, interface, multi-thread only. jordan_curve(using isinside), multi_curves(using floodfill)
58-
[2.126074484 13.096371426; 2.496373027 125.23088408; 5.242287246 596.261015286; 7.987274914 1743.300632586]
59-
60-
61-
1-3-500, interface, inpolygon
62-
[100, 300, 500]
63-
[1.248799153 0.530269039; 2.28104107 4.735589021; 6.293578857 11.423713058]
64-
32
65-
66-
1-3-500, interface, Floodfill
67-
[100, 300, 500][1.291998074 0.123935482; 3.388728651 5.878153884; 69.895109677 84.980423578]
68-
32
69-
70-
1-3-500, multi_curves, Floodfill
71-
[100, 300, 500][2.400877896 2.741995989; 38.038218511 92.339324457; 476.64809553 833.91326708]
72-
32
73-
74-
1-3-500, multi_curves, Floodfill
75-
[100, 300, 500][0.5009443733333333 0.891537955; 12.114947880666668 28.633708910333336; 133.44351538533337 261.82990826500003]
76-
77-
==#

src/distance_function.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import DataFrames, DelimitedFiles, Luxor, BenchmarkTools
44
using DataFrames, DelimitedFiles, Luxor, BenchmarkTools
55

66

7-
# 定義上のある点に対して全てのganma曲線上との距離を算出
7+
# Calculate the distance between a point on all ganma curves for a given point in the definition.
88
function distanceToCurve(px::Float64, py::Float64, gem::Array) # TODO: 型
9-
min_distance = 10000.0 # 初期値は大きく
9+
min_distance = 10000.0
1010
for i = 1:length(gem[:, 1])
1111
distnow = sqrt((gem[i, 1] - px)^2 + (gem[i, 2] - py)^2)
1212
if (distnow < min_distance)
@@ -58,8 +58,8 @@ function create_signed_distance_function(_x::Array, _y::Array, _gamma::Array)
5858
for indexI = 1:length(_y)
5959
for indexJ = 1:length(_x)
6060
sdist = 1.0 * distanceToCurve(_x[indexJ], _y[indexI], _gamma)
61-
# ganmaが閉曲線でないと成立しない。
62-
# omegaとの境界線上はErrorになる
61+
# ganma must be a closed curve.
62+
# Error happened when the point is on the edge of subdomain.
6363
if Point(_x[indexJ], _y[indexI]) in [Point(_gamma[i, 1], _gamma[i, 2]) for i = 1:length(_gamma[:, 1])]
6464
sdist = 0
6565
elseif isinside(Point(_x[indexJ], _y[indexI]), [Point(_gamma[i, 1], _gamma[i, 2]) for i = 1:length(_gamma[:, 1])])

0 commit comments

Comments
 (0)