jenncad 1.0.0.pre.alpha7 → 1.0.0.pre.alpha8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 59b41052c4c676ae59a808744715a5e10b1c1086350d4c7769b87d054f51d171
4
- data.tar.gz: a620928785ad237699d0afff433912a8b5c5f6d765492d4d1f72d4d4d83fb962
3
+ metadata.gz: 6f2310cb82dee6ece32a91135d15ffe4c6d69695e4af8ed9aabd91906ce22088
4
+ data.tar.gz: b36e9d1c8f926fb2858fb017aaced7cfe363b9c7e26fa3bd071eb677bff90e3c
5
5
  SHA512:
6
- metadata.gz: 2118f2cff401f4874c6dda0f801cfda1666e0b032158e088ff83ecf24072654a7545fc4ecd9e245398d2de2497f7b363a7a2fe4db90856d87a9a2a60ff39816b
7
- data.tar.gz: dd82a60377991ec146d6d9c259e19df75ee752b25eb1b44ed5cc2b33aea3f7b791726dd8ee12182ac323ad7902f75da5b8d5127858efa235d4792ac0755fa52e
6
+ metadata.gz: e1877c0c6f9f7bc509b8aacc97383ed451bc50b7de61c6dafd49e2b25ec51da4b877b683ddbe0563c69c771aba4e8a543c71aee9be0708d5b08ef593b0053d23
7
+ data.tar.gz: 0a25cd07dd118d1beb5f819f3ec60262cabb9793b5867d93d642ee95e64ff2f8229d72283ad98ca6d197b79e273f4a00e4aba2c9e709dcb7c17dd7b7e4f4a6e9
data/bin/jenncad CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
  require "jenncad"
3
-
4
3
  JennCad::Commands.register "", JennCad::Commands::Observe
5
4
  JennCad::Commands.register "run", JennCad::Commands::Observe
6
5
  JennCad::Commands.register "build", JennCad::Commands::Build
@@ -1,3 +1,4 @@
1
+ require "dry/cli"
1
2
  module JennCad
2
3
  module Commands
3
4
  extend Dry::CLI::Registry
@@ -57,6 +57,13 @@ module JennCad::Primitives
57
57
  res
58
58
  end
59
59
 
60
+ # Centers the cylinder around it's center point by height
61
+ # This will transform the cylinder around the center point.
62
+ def cz
63
+ @transformations << Move.new(z: -@z / 2.0)
64
+ self
65
+ end
66
+
60
67
  def handle_fn
61
68
  case @opts[:fn]
62
69
  when nil, 0
@@ -43,18 +43,19 @@ module JennCad::Primitives
43
43
  def to_openscad
44
44
  return cube(@opts) if @d == 0
45
45
  # make diameter not bigger than any side
46
- @d = [@d, @x, @y].min
46
+ d = [@d, @x, @y].min
47
47
  res = HullObject.new(
48
- cylinder(d:@d, h:z+z_margin),
49
- cylinder(d:@d).move(x: @x - @d, y: 0),
50
- cylinder(d:@d).move(x: 0, y: @y - @d),
51
- cylinder(d:@d).move(x: @x - @d, y: @y - @d),
52
- ).moveh(xy: @d)
48
+ cylinder(d:d, h:z+z_margin),
49
+ cylinder(d:d).move(x: @x - d, y: 0),
50
+ cylinder(d:d).move(x: 0, y: @y - d),
51
+ cylinder(d:d).move(x: @x - d, y: @y - d),
52
+ ).moveh(xy: d)
53
53
 
54
54
  res += flat_edge(@opts[:flat_edges])
55
55
 
56
56
  res.transformations = @transformations
57
57
  res.moveh(centered_axis.to_h{|a| [a, -@opts[a]] })
58
+ res
58
59
  end
59
60
 
60
61
  def flat_edge(edge)
@@ -1,4 +1,4 @@
1
1
  module JennCad
2
- VERSION = "1.0.0-alpha7"
2
+ VERSION = "1.0.0-alpha8"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jenncad
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.alpha7
4
+ version: 1.0.0.pre.alpha8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jennifer Glauche
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-22 00:00:00.000000000 Z
11
+ date: 2022-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: geo3d
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  - !ruby/object:Gem::Version
169
169
  version: 1.3.1
170
170
  requirements: []
171
- rubygems_version: 3.2.3
171
+ rubygems_version: 3.0.9
172
172
  signing_key:
173
173
  specification_version: 4
174
174
  summary: TBD