lithop 0.2.0 → 0.4.0

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.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/Cargo.lock +284 -0
  4. data/Cargo.toml +6 -0
  5. data/README.md +34 -13
  6. data/RELEASING.md +24 -6
  7. data/docs/README.md +6 -3
  8. data/docs/artifacts.md +35 -16
  9. data/docs/bambu-studio.md +17 -11
  10. data/docs/calibration.md +4 -4
  11. data/docs/color-model.md +20 -18
  12. data/docs/command.md +53 -14
  13. data/docs/config.md +43 -31
  14. data/docs/getting-started.md +17 -8
  15. data/docs/images/cmyw-lithophane-preview.png +0 -0
  16. data/docs/local-ui.md +117 -0
  17. data/docs/tiling.md +20 -19
  18. data/docs/troubleshooting.md +12 -2
  19. data/ext/lithop_native/Cargo.toml +17 -0
  20. data/ext/lithop_native/build.rs +4 -0
  21. data/ext/lithop_native/extconf.rb +6 -0
  22. data/ext/lithop_native/src/column_mesh.rs +388 -0
  23. data/ext/lithop_native/src/lib.rs +37 -0
  24. data/ext/lithop_native/src/mesh.rs +187 -0
  25. data/ext/lithop_native/src/palette.rs +67 -0
  26. data/ext/lithop_native/src/xml.rs +134 -0
  27. data/lib/lithop/calibration/export.rb +2 -2
  28. data/lib/lithop/calibration/target.rb +5 -5
  29. data/lib/lithop/cli/image_adjustment_options.rb +33 -0
  30. data/lib/lithop/cli/image_options.rb +5 -18
  31. data/lib/lithop/cli/options.rb +17 -4
  32. data/lib/lithop/cli.rb +28 -0
  33. data/lib/lithop/export/color_metadata.rb +46 -23
  34. data/lib/lithop/export/generation.rb +38 -27
  35. data/lib/lithop/export/job.rb +2 -2
  36. data/lib/lithop/export/metadata.rb +8 -3
  37. data/lib/lithop/export/planning.rb +82 -45
  38. data/lib/lithop/export/previews.rb +25 -1
  39. data/lib/lithop/export/print_readme.rb +20 -4
  40. data/lib/lithop/formats/three_mf/bambu_metadata.rb +11 -8
  41. data/lib/lithop/formats/three_mf/mesh.rb +72 -3
  42. data/lib/lithop/formats/three_mf/model_writer.rb +21 -21
  43. data/lib/lithop/formats/three_mf/part_writer.rb +37 -0
  44. data/lib/lithop/formats/three_mf.rb +1 -1
  45. data/lib/lithop/image/pipeline.rb +84 -31
  46. data/lib/lithop/image/svg_loader.rb +16 -7
  47. data/lib/lithop/job_execution.rb +132 -4
  48. data/lib/lithop/layer_structure.rb +0 -9
  49. data/lib/lithop/mesh/column_geometry.rb +8 -0
  50. data/lib/lithop/mesh/column_topology.rb +2 -0
  51. data/lib/lithop/model/filament_profile.rb +3 -3
  52. data/lib/lithop/model/material_display_map.rb +2 -1
  53. data/lib/lithop/model/material_model.rb +17 -5
  54. data/lib/lithop/model/palette.rb +21 -3
  55. data/lib/lithop/model/z_region_model.rb +44 -0
  56. data/lib/lithop/native.rb +39 -0
  57. data/lib/lithop/settings.rb +147 -15
  58. data/lib/lithop/settings_file.rb +1 -0
  59. data/lib/lithop/tiling.rb +3 -2
  60. data/lib/lithop/version.rb +1 -1
  61. data/lib/lithop/web/app.rb +517 -0
  62. data/lib/lithop/web/bambu_studio_launcher.rb +82 -0
  63. data/lib/lithop/web/job_launcher.rb +214 -0
  64. data/lib/lithop/web/job_store.rb +390 -0
  65. data/lib/lithop/web/preview_store.rb +182 -0
  66. data/lib/lithop/web/public/app.css +330 -0
  67. data/lib/lithop/web/public/app.js +1949 -0
  68. data/lib/lithop/web/server.rb +21 -0
  69. data/lib/lithop/web/settings_form.rb +67 -0
  70. data/lib/lithop/web/settings_library.rb +154 -0
  71. data/lib/lithop/web/views/index.erb +418 -0
  72. data/lib/lithop/web/worker.rb +27 -0
  73. data/lib/lithop.rb +3 -1
  74. data/sig/lithop.rbs +41 -0
  75. metadata +86 -3
  76. data/lib/lithop/model/layer_region_model.rb +0 -24
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lithop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ogom
@@ -9,6 +9,48 @@ bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: puma
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '7.0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '7.0'
26
+ - !ruby/object:Gem::Dependency
27
+ name: rackup
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '2.2'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '2.2'
40
+ - !ruby/object:Gem::Dependency
41
+ name: rb_sys
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: 0.9.128
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: 0.9.128
12
54
  - !ruby/object:Gem::Dependency
13
55
  name: rexml
14
56
  requirement: !ruby/object:Gem::Requirement
@@ -51,16 +93,33 @@ dependencies:
51
93
  - - "~>"
52
94
  - !ruby/object:Gem::Version
53
95
  version: '3.7'
96
+ - !ruby/object:Gem::Dependency
97
+ name: sinatra
98
+ requirement: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '4.2'
103
+ type: :runtime
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: '4.2'
54
110
  description: Lithop converts JPEG, PNG, and SVG images locally into STL and multipart
55
111
  CMYW 3MF models for backlit lithophane printing.
56
112
  email:
57
113
  - ogom@users.noreply.github.com
58
114
  executables:
59
115
  - lithop
60
- extensions: []
116
+ extensions:
117
+ - ext/lithop_native/extconf.rb
61
118
  extra_rdoc_files: []
62
119
  files:
63
120
  - CHANGELOG.md
121
+ - Cargo.lock
122
+ - Cargo.toml
64
123
  - LICENSE
65
124
  - README.md
66
125
  - RELEASING.md
@@ -73,8 +132,18 @@ files:
73
132
  - docs/command.md
74
133
  - docs/config.md
75
134
  - docs/getting-started.md
135
+ - docs/images/cmyw-lithophane-preview.png
136
+ - docs/local-ui.md
76
137
  - docs/tiling.md
77
138
  - docs/troubleshooting.md
139
+ - ext/lithop_native/Cargo.toml
140
+ - ext/lithop_native/build.rs
141
+ - ext/lithop_native/extconf.rb
142
+ - ext/lithop_native/src/column_mesh.rs
143
+ - ext/lithop_native/src/lib.rs
144
+ - ext/lithop_native/src/mesh.rs
145
+ - ext/lithop_native/src/palette.rs
146
+ - ext/lithop_native/src/xml.rs
78
147
  - lib/lithop.rb
79
148
  - lib/lithop/calibration/export.rb
80
149
  - lib/lithop/calibration/profile.rb
@@ -85,6 +154,7 @@ files:
85
154
  - lib/lithop/calibration/thickness_selector.rb
86
155
  - lib/lithop/cli.rb
87
156
  - lib/lithop/cli/calibration.rb
157
+ - lib/lithop/cli/image_adjustment_options.rb
88
158
  - lib/lithop/cli/image_options.rb
89
159
  - lib/lithop/cli/options.rb
90
160
  - lib/lithop/cli/settings.rb
@@ -119,17 +189,30 @@ files:
119
189
  - lib/lithop/mesh/voxel_geometry.rb
120
190
  - lib/lithop/mesh/voxel_topology.rb
121
191
  - lib/lithop/model/filament_profile.rb
122
- - lib/lithop/model/layer_region_model.rb
123
192
  - lib/lithop/model/material_display_map.rb
124
193
  - lib/lithop/model/material_model.rb
125
194
  - lib/lithop/model/palette.rb
126
195
  - lib/lithop/model/thickness.rb
196
+ - lib/lithop/model/z_region_model.rb
197
+ - lib/lithop/native.rb
127
198
  - lib/lithop/reference_three_mf.rb
128
199
  - lib/lithop/sampling_grid.rb
129
200
  - lib/lithop/settings.rb
130
201
  - lib/lithop/settings_file.rb
131
202
  - lib/lithop/tiling.rb
132
203
  - lib/lithop/version.rb
204
+ - lib/lithop/web/app.rb
205
+ - lib/lithop/web/bambu_studio_launcher.rb
206
+ - lib/lithop/web/job_launcher.rb
207
+ - lib/lithop/web/job_store.rb
208
+ - lib/lithop/web/preview_store.rb
209
+ - lib/lithop/web/public/app.css
210
+ - lib/lithop/web/public/app.js
211
+ - lib/lithop/web/server.rb
212
+ - lib/lithop/web/settings_form.rb
213
+ - lib/lithop/web/settings_library.rb
214
+ - lib/lithop/web/views/index.erb
215
+ - lib/lithop/web/worker.rb
133
216
  - sig/lithop.rbs
134
217
  homepage: https://github.com/ogom/lithop
135
218
  licenses:
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Lithop
4
- # Restricts a material model to one contiguous Z-layer range while preserving global Z coordinates.
5
- class LayerRegionModel
6
- Cell = Data.define(:materials)
7
-
8
- attr_reader :columns, :rows, :x_boundaries, :y_boundaries, :z_boundaries, :cells, :layer_range
9
-
10
- def initialize(model:, layer_range:)
11
- @columns = model.columns
12
- @rows = model.rows
13
- @x_boundaries = model.x_boundaries
14
- @y_boundaries = model.y_boundaries
15
- @layer_range = layer_range
16
- @z_boundaries = model.z_boundaries[layer_range.begin..layer_range.end].freeze
17
- @cells = model.cells.map do |cell|
18
- Cell.new(materials: cell.materials.slice(layer_range).to_a.freeze)
19
- end.freeze
20
- end
21
-
22
- def materials = @materials ||= cells.flat_map(&:materials).uniq.freeze
23
- end
24
- end