From 0113a4846ca0822649882d09a88063498af91853 Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Wed, 9 Dec 2020 23:48:43 -0600 Subject: [PATCH 1/2] ignore dll --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9e74f1c..75dc8e3 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ nimcache *.pdb *.ilk .* +*.dll From 120ad0ad56a7de81c80c838549fe6162b58f38da Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Thu, 10 Dec 2020 00:27:58 -0600 Subject: [PATCH 2/2] bumpy segment --- pixie.nimble | 1 + src/pixie/common.nim | 24 ------------------------ src/pixie/images.nim | 2 +- src/pixie/paths.nim | 2 +- 4 files changed, 3 insertions(+), 26 deletions(-) diff --git a/pixie.nimble b/pixie.nimble index 90a726d..012538a 100644 --- a/pixie.nimble +++ b/pixie.nimble @@ -11,3 +11,4 @@ requires "chroma >= 0.1.5" requires "zippy >= 0.3.5" requires "flatty >= 0.1.2" requires "nimsimd >= 0.4.6" +requires "bumpy >= 0.1.0" diff --git a/src/pixie/common.nim b/src/pixie/common.nim index 2ac7cb5..973c057 100644 --- a/src/pixie/common.nim +++ b/src/pixie/common.nim @@ -3,30 +3,6 @@ import vmath type PixieError* = object of ValueError ## Raised if an operation fails. - Segment* = object - ## A math segment from point "at" to point "to" - at*: Vec2 - to*: Vec2 - -proc segment*(at, to: Vec2): Segment {.inline.} = - result.at = at - result.to = to - -proc intersects*(a, b: Segment, at: var Vec2): bool {.inline.} = - ## Checks if the a segment intersects b segment. - ## If it returns true, at will have point of intersection - let - s1 = a.to - a.at - s2 = b.to - b.at - denominator = (-s2.x * s1.y + s1.x * s2.y) - s = (-s1.y * (a.at.x - b.at.x) + s1.x * (a.at.y - b.at.y)) / denominator - t = (s2.x * (a.at.y - b.at.y) - s2.y * (a.at.x - b.at.x)) / denominator - - if s >= 0 and s < 1 and t >= 0 and t < 1: - at = a.at + (t * s1) - return true - return false - proc fractional*(v: float32): float32 {.inline.} = ## Returns unsigned fraction part of the float. ## -13.7868723 -> 0.7868723 diff --git a/src/pixie/images.nim b/src/pixie/images.nim index 30e90c5..ba472a0 100644 --- a/src/pixie/images.nim +++ b/src/pixie/images.nim @@ -1,4 +1,4 @@ -import chroma, blends, vmath, common, nimsimd/sse2 +import chroma, blends, bumpy, vmath, common, nimsimd/sse2 const h = 0.5.float32 diff --git a/src/pixie/paths.nim b/src/pixie/paths.nim index 2d7a184..aa00731 100644 --- a/src/pixie/paths.nim +++ b/src/pixie/paths.nim @@ -1,4 +1,4 @@ -import vmath, images, chroma, strutils, algorithm, common +import vmath, images, chroma, strutils, algorithm, common, bumpy type