machinome-node-build123d 0.9.0__tar.gz
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.
- machinome_node_build123d-0.9.0/LICENSE +21 -0
- machinome_node_build123d-0.9.0/LICENSES/CERN-OHL-S-2.0.txt +289 -0
- machinome_node_build123d-0.9.0/LICENSES/GPL-2.0-or-later.txt +338 -0
- machinome_node_build123d-0.9.0/PKG-INFO +47 -0
- machinome_node_build123d-0.9.0/README.md +21 -0
- machinome_node_build123d-0.9.0/machinome/node/build123d.py +306 -0
- machinome_node_build123d-0.9.0/machinome_node_build123d.egg-info/PKG-INFO +47 -0
- machinome_node_build123d-0.9.0/machinome_node_build123d.egg-info/SOURCES.txt +11 -0
- machinome_node_build123d-0.9.0/machinome_node_build123d.egg-info/dependency_links.txt +1 -0
- machinome_node_build123d-0.9.0/machinome_node_build123d.egg-info/requires.txt +5 -0
- machinome_node_build123d-0.9.0/machinome_node_build123d.egg-info/top_level.txt +1 -0
- machinome_node_build123d-0.9.0/pyproject.toml +50 -0
- machinome_node_build123d-0.9.0/setup.cfg +4 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Machinome - Source code for machines
|
|
2
|
+
Copyright (C) 2023-2026 Luis Henrique Cassis Fagundes
|
|
3
|
+
|
|
4
|
+
Machinome is free software, offered under two licences at your option:
|
|
5
|
+
|
|
6
|
+
* the GNU General Public License as published by the Free Software
|
|
7
|
+
Foundation, either version 2 of the License or any later version; or
|
|
8
|
+
|
|
9
|
+
* the CERN Open Hardware Licence Version 2 - Strongly Reciprocal
|
|
10
|
+
(CERN-OHL-S), version 2.0 or any later version published by CERN.
|
|
11
|
+
|
|
12
|
+
SPDX-License-Identifier: GPL-2.0-or-later OR CERN-OHL-S-2.0+
|
|
13
|
+
|
|
14
|
+
The full text of each licence is in the LICENSES directory:
|
|
15
|
+
LICENSES/GPL-2.0-or-later.txt
|
|
16
|
+
LICENSES/CERN-OHL-S-2.0.txt
|
|
17
|
+
|
|
18
|
+
Source Location: https://github.com/machinome/machinome
|
|
19
|
+
|
|
20
|
+
Machinome is distributed WITHOUT ANY WARRANTY; the licence you choose
|
|
21
|
+
states the disclaimer that applies.
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
CERN Open Hardware Licence Version 2 - Strongly Reciprocal
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
Preamble
|
|
5
|
+
|
|
6
|
+
CERN has developed this licence to promote collaboration among
|
|
7
|
+
hardware designers and to provide a legal tool which supports the
|
|
8
|
+
freedom to use, study, modify, share and distribute hardware designs
|
|
9
|
+
and products based on those designs. Version 2 of the CERN Open
|
|
10
|
+
Hardware Licence comes in three variants: CERN-OHL-P (permissive); and
|
|
11
|
+
two reciprocal licences: CERN-OHL-W (weakly reciprocal) and this
|
|
12
|
+
licence, CERN-OHL-S (strongly reciprocal).
|
|
13
|
+
|
|
14
|
+
The CERN-OHL-S is copyright CERN 2020. Anyone is welcome to use it, in
|
|
15
|
+
unmodified form only.
|
|
16
|
+
|
|
17
|
+
Use of this Licence does not imply any endorsement by CERN of any
|
|
18
|
+
Licensor or their designs nor does it imply any involvement by CERN in
|
|
19
|
+
their development.
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
1 Definitions
|
|
23
|
+
|
|
24
|
+
1.1 'Licence' means this CERN-OHL-S.
|
|
25
|
+
|
|
26
|
+
1.2 'Compatible Licence' means
|
|
27
|
+
|
|
28
|
+
a) any earlier version of the CERN Open Hardware licence, or
|
|
29
|
+
|
|
30
|
+
b) any version of the CERN-OHL-S, or
|
|
31
|
+
|
|
32
|
+
c) any licence which permits You to treat the Source to which
|
|
33
|
+
it applies as licensed under CERN-OHL-S provided that on
|
|
34
|
+
Conveyance of any such Source, or any associated Product You
|
|
35
|
+
treat the Source in question as being licensed under
|
|
36
|
+
CERN-OHL-S.
|
|
37
|
+
|
|
38
|
+
1.3 'Source' means information such as design materials or digital
|
|
39
|
+
code which can be applied to Make or test a Product or to
|
|
40
|
+
prepare a Product for use, Conveyance or sale, regardless of its
|
|
41
|
+
medium or how it is expressed. It may include Notices.
|
|
42
|
+
|
|
43
|
+
1.4 'Covered Source' means Source that is explicitly made available
|
|
44
|
+
under this Licence.
|
|
45
|
+
|
|
46
|
+
1.5 'Product' means any device, component, work or physical object,
|
|
47
|
+
whether in finished or intermediate form, arising from the use,
|
|
48
|
+
application or processing of Covered Source.
|
|
49
|
+
|
|
50
|
+
1.6 'Make' means to create or configure something, whether by
|
|
51
|
+
manufacture, assembly, compiling, loading or applying Covered
|
|
52
|
+
Source or another Product or otherwise.
|
|
53
|
+
|
|
54
|
+
1.7 'Available Component' means any part, sub-assembly, library or
|
|
55
|
+
code which:
|
|
56
|
+
|
|
57
|
+
a) is licensed to You as Complete Source under a Compatible
|
|
58
|
+
Licence; or
|
|
59
|
+
|
|
60
|
+
b) is available, at the time a Product or the Source containing
|
|
61
|
+
it is first Conveyed, to You and any other prospective
|
|
62
|
+
licensees
|
|
63
|
+
|
|
64
|
+
i) as a physical part with sufficient rights and
|
|
65
|
+
information (including any configuration and
|
|
66
|
+
programming files and information about its
|
|
67
|
+
characteristics and interfaces) to enable it either to
|
|
68
|
+
be Made itself, or to be sourced and used to Make the
|
|
69
|
+
Product; or
|
|
70
|
+
ii) as part of the normal distribution of a tool used to
|
|
71
|
+
design or Make the Product.
|
|
72
|
+
|
|
73
|
+
1.8 'Complete Source' means the set of all Source necessary to Make
|
|
74
|
+
a Product, in the preferred form for making modifications,
|
|
75
|
+
including necessary installation and interfacing information
|
|
76
|
+
both for the Product, and for any included Available Components.
|
|
77
|
+
If the format is proprietary, it must also be made available in
|
|
78
|
+
a format (if the proprietary tool can create it) which is
|
|
79
|
+
viewable with a tool available to potential licensees and
|
|
80
|
+
licensed under a licence approved by the Free Software
|
|
81
|
+
Foundation or the Open Source Initiative. Complete Source need
|
|
82
|
+
not include the Source of any Available Component, provided that
|
|
83
|
+
You include in the Complete Source sufficient information to
|
|
84
|
+
enable a recipient to Make or source and use the Available
|
|
85
|
+
Component to Make the Product.
|
|
86
|
+
|
|
87
|
+
1.9 'Source Location' means a location where a Licensor has placed
|
|
88
|
+
Covered Source, and which that Licensor reasonably believes will
|
|
89
|
+
remain easily accessible for at least three years for anyone to
|
|
90
|
+
obtain a digital copy.
|
|
91
|
+
|
|
92
|
+
1.10 'Notice' means copyright, acknowledgement and trademark notices,
|
|
93
|
+
Source Location references, modification notices (subsection
|
|
94
|
+
3.3(b)) and all notices that refer to this Licence and to the
|
|
95
|
+
disclaimer of warranties that are included in the Covered
|
|
96
|
+
Source.
|
|
97
|
+
|
|
98
|
+
1.11 'Licensee' or 'You' means any person exercising rights under
|
|
99
|
+
this Licence.
|
|
100
|
+
|
|
101
|
+
1.12 'Licensor' means a natural or legal person who creates or
|
|
102
|
+
modifies Covered Source. A person may be a Licensee and a
|
|
103
|
+
Licensor at the same time.
|
|
104
|
+
|
|
105
|
+
1.13 'Convey' means to communicate to the public or distribute.
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
2 Applicability
|
|
109
|
+
|
|
110
|
+
2.1 This Licence governs the use, copying, modification, Conveying
|
|
111
|
+
of Covered Source and Products, and the Making of Products. By
|
|
112
|
+
exercising any right granted under this Licence, You irrevocably
|
|
113
|
+
accept these terms and conditions.
|
|
114
|
+
|
|
115
|
+
2.2 This Licence is granted by the Licensor directly to You, and
|
|
116
|
+
shall apply worldwide and without limitation in time.
|
|
117
|
+
|
|
118
|
+
2.3 You shall not attempt to restrict by contract or otherwise the
|
|
119
|
+
rights granted under this Licence to other Licensees.
|
|
120
|
+
|
|
121
|
+
2.4 This Licence is not intended to restrict fair use, fair dealing,
|
|
122
|
+
or any other similar right.
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
3 Copying, modifying and Conveying Covered Source
|
|
126
|
+
|
|
127
|
+
3.1 You may copy and Convey verbatim copies of Covered Source, in
|
|
128
|
+
any medium, provided You retain all Notices.
|
|
129
|
+
|
|
130
|
+
3.2 You may modify Covered Source, other than Notices, provided that
|
|
131
|
+
You irrevocably undertake to make that modified Covered Source
|
|
132
|
+
available from a Source Location should You Convey a Product in
|
|
133
|
+
circumstances where the recipient does not otherwise receive a
|
|
134
|
+
copy of the modified Covered Source. In each case subsection 3.3
|
|
135
|
+
shall apply.
|
|
136
|
+
|
|
137
|
+
You may only delete Notices if they are no longer applicable to
|
|
138
|
+
the corresponding Covered Source as modified by You and You may
|
|
139
|
+
add additional Notices applicable to Your modifications.
|
|
140
|
+
Including Covered Source in a larger work is modifying the
|
|
141
|
+
Covered Source, and the larger work becomes modified Covered
|
|
142
|
+
Source.
|
|
143
|
+
|
|
144
|
+
3.3 You may Convey modified Covered Source (with the effect that You
|
|
145
|
+
shall also become a Licensor) provided that You:
|
|
146
|
+
|
|
147
|
+
a) retain Notices as required in subsection 3.2;
|
|
148
|
+
|
|
149
|
+
b) add a Notice to the modified Covered Source stating that You
|
|
150
|
+
have modified it, with the date and brief description of how
|
|
151
|
+
You have modified it;
|
|
152
|
+
|
|
153
|
+
c) add a Source Location Notice for the modified Covered Source
|
|
154
|
+
if You Convey in circumstances where the recipient does not
|
|
155
|
+
otherwise receive a copy of the modified Covered Source; and
|
|
156
|
+
|
|
157
|
+
d) license the modified Covered Source under the terms and
|
|
158
|
+
conditions of this Licence (or, as set out in subsection
|
|
159
|
+
8.3, a later version, if permitted by the licence of the
|
|
160
|
+
original Covered Source). Such modified Covered Source must
|
|
161
|
+
be licensed as a whole, but excluding Available Components
|
|
162
|
+
contained in it, which remain licensed under their own
|
|
163
|
+
applicable licences.
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
4 Making and Conveying Products
|
|
167
|
+
|
|
168
|
+
You may Make Products, and/or Convey them, provided that You either
|
|
169
|
+
provide each recipient with a copy of the Complete Source or ensure
|
|
170
|
+
that each recipient is notified of the Source Location of the Complete
|
|
171
|
+
Source. That Complete Source is Covered Source, and You must
|
|
172
|
+
accordingly satisfy Your obligations set out in subsection 3.3. If
|
|
173
|
+
specified in a Notice, the Product must visibly and securely display
|
|
174
|
+
the Source Location on it or its packaging or documentation in the
|
|
175
|
+
manner specified in that Notice.
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
5 Research and Development
|
|
179
|
+
|
|
180
|
+
You may Convey Covered Source, modified Covered Source or Products to
|
|
181
|
+
a legal entity carrying out development, testing or quality assurance
|
|
182
|
+
work on Your behalf provided that the work is performed on terms which
|
|
183
|
+
prevent the entity from both using the Source or Products for its own
|
|
184
|
+
internal purposes and Conveying the Source or Products or any
|
|
185
|
+
modifications to them to any person other than You. Any modifications
|
|
186
|
+
made by the entity shall be deemed to be made by You pursuant to
|
|
187
|
+
subsection 3.2.
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
6 DISCLAIMER AND LIABILITY
|
|
191
|
+
|
|
192
|
+
6.1 DISCLAIMER OF WARRANTY -- The Covered Source and any Products
|
|
193
|
+
are provided 'as is' and any express or implied warranties,
|
|
194
|
+
including, but not limited to, implied warranties of
|
|
195
|
+
merchantability, of satisfactory quality, non-infringement of
|
|
196
|
+
third party rights, and fitness for a particular purpose or use
|
|
197
|
+
are disclaimed in respect of any Source or Product to the
|
|
198
|
+
maximum extent permitted by law. The Licensor makes no
|
|
199
|
+
representation that any Source or Product does not or will not
|
|
200
|
+
infringe any patent, copyright, trade secret or other
|
|
201
|
+
proprietary right. The entire risk as to the use, quality, and
|
|
202
|
+
performance of any Source or Product shall be with You and not
|
|
203
|
+
the Licensor. This disclaimer of warranty is an essential part
|
|
204
|
+
of this Licence and a condition for the grant of any rights
|
|
205
|
+
granted under this Licence.
|
|
206
|
+
|
|
207
|
+
6.2 EXCLUSION AND LIMITATION OF LIABILITY -- The Licensor shall, to
|
|
208
|
+
the maximum extent permitted by law, have no liability for
|
|
209
|
+
direct, indirect, special, incidental, consequential, exemplary,
|
|
210
|
+
punitive or other damages of any character including, without
|
|
211
|
+
limitation, procurement of substitute goods or services, loss of
|
|
212
|
+
use, data or profits, or business interruption, however caused
|
|
213
|
+
and on any theory of contract, warranty, tort (including
|
|
214
|
+
negligence), product liability or otherwise, arising in any way
|
|
215
|
+
in relation to the Covered Source, modified Covered Source
|
|
216
|
+
and/or the Making or Conveyance of a Product, even if advised of
|
|
217
|
+
the possibility of such damages, and You shall hold the
|
|
218
|
+
Licensor(s) free and harmless from any liability, costs,
|
|
219
|
+
damages, fees and expenses, including claims by third parties,
|
|
220
|
+
in relation to such use.
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
7 Patents
|
|
224
|
+
|
|
225
|
+
7.1 Subject to the terms and conditions of this Licence, each
|
|
226
|
+
Licensor hereby grants to You a perpetual, worldwide,
|
|
227
|
+
non-exclusive, no-charge, royalty-free, irrevocable (except as
|
|
228
|
+
stated in subsections 7.2 and 8.4) patent license to Make, have
|
|
229
|
+
Made, use, offer to sell, sell, import, and otherwise transfer
|
|
230
|
+
the Covered Source and Products, where such licence applies only
|
|
231
|
+
to those patent claims licensable by such Licensor that are
|
|
232
|
+
necessarily infringed by exercising rights under the Covered
|
|
233
|
+
Source as Conveyed by that Licensor.
|
|
234
|
+
|
|
235
|
+
7.2 If You institute patent litigation against any entity (including
|
|
236
|
+
a cross-claim or counterclaim in a lawsuit) alleging that the
|
|
237
|
+
Covered Source or a Product constitutes direct or contributory
|
|
238
|
+
patent infringement, or You seek any declaration that a patent
|
|
239
|
+
licensed to You under this Licence is invalid or unenforceable
|
|
240
|
+
then any rights granted to You under this Licence shall
|
|
241
|
+
terminate as of the date such process is initiated.
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
8 General
|
|
245
|
+
|
|
246
|
+
8.1 If any provisions of this Licence are or subsequently become
|
|
247
|
+
invalid or unenforceable for any reason, the remaining
|
|
248
|
+
provisions shall remain effective.
|
|
249
|
+
|
|
250
|
+
8.2 You shall not use any of the name (including acronyms and
|
|
251
|
+
abbreviations), image, or logo by which the Licensor or CERN is
|
|
252
|
+
known, except where needed to comply with section 3, or where
|
|
253
|
+
the use is otherwise allowed by law. Any such permitted use
|
|
254
|
+
shall be factual and shall not be made so as to suggest any kind
|
|
255
|
+
of endorsement or implication of involvement by the Licensor or
|
|
256
|
+
its personnel.
|
|
257
|
+
|
|
258
|
+
8.3 CERN may publish updated versions and variants of this Licence
|
|
259
|
+
which it considers to be in the spirit of this version, but may
|
|
260
|
+
differ in detail to address new problems or concerns. New
|
|
261
|
+
versions will be published with a unique version number and a
|
|
262
|
+
variant identifier specifying the variant. If the Licensor has
|
|
263
|
+
specified that a given variant applies to the Covered Source
|
|
264
|
+
without specifying a version, You may treat that Covered Source
|
|
265
|
+
as being released under any version of the CERN-OHL with that
|
|
266
|
+
variant. If no variant is specified, the Covered Source shall be
|
|
267
|
+
treated as being released under CERN-OHL-S. The Licensor may
|
|
268
|
+
also specify that the Covered Source is subject to a specific
|
|
269
|
+
version of the CERN-OHL or any later version in which case You
|
|
270
|
+
may apply this or any later version of CERN-OHL with the same
|
|
271
|
+
variant identifier published by CERN.
|
|
272
|
+
|
|
273
|
+
8.4 This Licence shall terminate with immediate effect if You fail
|
|
274
|
+
to comply with any of its terms and conditions.
|
|
275
|
+
|
|
276
|
+
8.5 However, if You cease all breaches of this Licence, then Your
|
|
277
|
+
Licence from any Licensor is reinstated unless such Licensor has
|
|
278
|
+
terminated this Licence by giving You, while You remain in
|
|
279
|
+
breach, a notice specifying the breach and requiring You to cure
|
|
280
|
+
it within 30 days, and You have failed to come into compliance
|
|
281
|
+
in all material respects by the end of the 30 day period. Should
|
|
282
|
+
You repeat the breach after receipt of a cure notice and
|
|
283
|
+
subsequent reinstatement, this Licence will terminate
|
|
284
|
+
immediately and permanently. Section 6 shall continue to apply
|
|
285
|
+
after any termination.
|
|
286
|
+
|
|
287
|
+
8.6 This Licence shall not be enforceable except by a Licensor
|
|
288
|
+
acting as such, and third party beneficiary rights are
|
|
289
|
+
specifically excluded.
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
GNU GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 2, June 1991
|
|
3
|
+
|
|
4
|
+
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
|
5
|
+
<https://fsf.org/>
|
|
6
|
+
Everyone is permitted to copy and distribute verbatim copies
|
|
7
|
+
of this license document, but changing it is not allowed.
|
|
8
|
+
|
|
9
|
+
Preamble
|
|
10
|
+
|
|
11
|
+
The licenses for most software are designed to take away your
|
|
12
|
+
freedom to share and change it. By contrast, the GNU General Public
|
|
13
|
+
License is intended to guarantee your freedom to share and change free
|
|
14
|
+
software--to make sure the software is free for all its users. This
|
|
15
|
+
General Public License applies to most of the Free Software
|
|
16
|
+
Foundation's software and to any other program whose authors commit to
|
|
17
|
+
using it. (Some other Free Software Foundation software is covered by
|
|
18
|
+
the GNU Lesser General Public License instead.) You can apply it to
|
|
19
|
+
your programs, too.
|
|
20
|
+
|
|
21
|
+
When we speak of free software, we are referring to freedom, not
|
|
22
|
+
price. Our General Public Licenses are designed to make sure that you
|
|
23
|
+
have the freedom to distribute copies of free software (and charge for
|
|
24
|
+
this service if you wish), that you receive source code or can get it
|
|
25
|
+
if you want it, that you can change the software or use pieces of it
|
|
26
|
+
in new free programs; and that you know you can do these things.
|
|
27
|
+
|
|
28
|
+
To protect your rights, we need to make restrictions that forbid
|
|
29
|
+
anyone to deny you these rights or to ask you to surrender the rights.
|
|
30
|
+
These restrictions translate to certain responsibilities for you if you
|
|
31
|
+
distribute copies of the software, or if you modify it.
|
|
32
|
+
|
|
33
|
+
For example, if you distribute copies of such a program, whether
|
|
34
|
+
gratis or for a fee, you must give the recipients all the rights that
|
|
35
|
+
you have. You must make sure that they, too, receive or can get the
|
|
36
|
+
source code. And you must show them these terms so they know their
|
|
37
|
+
rights.
|
|
38
|
+
|
|
39
|
+
We protect your rights with two steps: (1) copyright the software, and
|
|
40
|
+
(2) offer you this license which gives you legal permission to copy,
|
|
41
|
+
distribute and/or modify the software.
|
|
42
|
+
|
|
43
|
+
Also, for each author's protection and ours, we want to make certain
|
|
44
|
+
that everyone understands that there is no warranty for this free
|
|
45
|
+
software. If the software is modified by someone else and passed on, we
|
|
46
|
+
want its recipients to know that what they have is not the original, so
|
|
47
|
+
that any problems introduced by others will not reflect on the original
|
|
48
|
+
authors' reputations.
|
|
49
|
+
|
|
50
|
+
Finally, any free program is threatened constantly by software
|
|
51
|
+
patents. We wish to avoid the danger that redistributors of a free
|
|
52
|
+
program will individually obtain patent licenses, in effect making the
|
|
53
|
+
program proprietary. To prevent this, we have made it clear that any
|
|
54
|
+
patent must be licensed for everyone's free use or not licensed at all.
|
|
55
|
+
|
|
56
|
+
The precise terms and conditions for copying, distribution and
|
|
57
|
+
modification follow.
|
|
58
|
+
|
|
59
|
+
GNU GENERAL PUBLIC LICENSE
|
|
60
|
+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
|
61
|
+
|
|
62
|
+
0. This License applies to any program or other work which contains
|
|
63
|
+
a notice placed by the copyright holder saying it may be distributed
|
|
64
|
+
under the terms of this General Public License. The "Program", below,
|
|
65
|
+
refers to any such program or work, and a "work based on the Program"
|
|
66
|
+
means either the Program or any derivative work under copyright law:
|
|
67
|
+
that is to say, a work containing the Program or a portion of it,
|
|
68
|
+
either verbatim or with modifications and/or translated into another
|
|
69
|
+
language. (Hereinafter, translation is included without limitation in
|
|
70
|
+
the term "modification".) Each licensee is addressed as "you".
|
|
71
|
+
|
|
72
|
+
Activities other than copying, distribution and modification are not
|
|
73
|
+
covered by this License; they are outside its scope. The act of
|
|
74
|
+
running the Program is not restricted, and the output from the Program
|
|
75
|
+
is covered only if its contents constitute a work based on the
|
|
76
|
+
Program (independent of having been made by running the Program).
|
|
77
|
+
Whether that is true depends on what the Program does.
|
|
78
|
+
|
|
79
|
+
1. You may copy and distribute verbatim copies of the Program's
|
|
80
|
+
source code as you receive it, in any medium, provided that you
|
|
81
|
+
conspicuously and appropriately publish on each copy an appropriate
|
|
82
|
+
copyright notice and disclaimer of warranty; keep intact all the
|
|
83
|
+
notices that refer to this License and to the absence of any warranty;
|
|
84
|
+
and give any other recipients of the Program a copy of this License
|
|
85
|
+
along with the Program.
|
|
86
|
+
|
|
87
|
+
You may charge a fee for the physical act of transferring a copy, and
|
|
88
|
+
you may at your option offer warranty protection in exchange for a fee.
|
|
89
|
+
|
|
90
|
+
2. You may modify your copy or copies of the Program or any portion
|
|
91
|
+
of it, thus forming a work based on the Program, and copy and
|
|
92
|
+
distribute such modifications or work under the terms of Section 1
|
|
93
|
+
above, provided that you also meet all of these conditions:
|
|
94
|
+
|
|
95
|
+
a) You must cause the modified files to carry prominent notices
|
|
96
|
+
stating that you changed the files and the date of any change.
|
|
97
|
+
|
|
98
|
+
b) You must cause any work that you distribute or publish, that in
|
|
99
|
+
whole or in part contains or is derived from the Program or any
|
|
100
|
+
part thereof, to be licensed as a whole at no charge to all third
|
|
101
|
+
parties under the terms of this License.
|
|
102
|
+
|
|
103
|
+
c) If the modified program normally reads commands interactively
|
|
104
|
+
when run, you must cause it, when started running for such
|
|
105
|
+
interactive use in the most ordinary way, to print or display an
|
|
106
|
+
announcement including an appropriate copyright notice and a
|
|
107
|
+
notice that there is no warranty (or else, saying that you provide
|
|
108
|
+
a warranty) and that users may redistribute the program under
|
|
109
|
+
these conditions, and telling the user how to view a copy of this
|
|
110
|
+
License. (Exception: if the Program itself is interactive but
|
|
111
|
+
does not normally print such an announcement, your work based on
|
|
112
|
+
the Program is not required to print an announcement.)
|
|
113
|
+
|
|
114
|
+
These requirements apply to the modified work as a whole. If
|
|
115
|
+
identifiable sections of that work are not derived from the Program,
|
|
116
|
+
and can be reasonably considered independent and separate works in
|
|
117
|
+
themselves, then this License, and its terms, do not apply to those
|
|
118
|
+
sections when you distribute them as separate works. But when you
|
|
119
|
+
distribute the same sections as part of a whole which is a work based
|
|
120
|
+
on the Program, the distribution of the whole must be on the terms of
|
|
121
|
+
this License, whose permissions for other licensees extend to the
|
|
122
|
+
entire whole, and thus to each and every part regardless of who wrote it.
|
|
123
|
+
|
|
124
|
+
Thus, it is not the intent of this section to claim rights or contest
|
|
125
|
+
your rights to work written entirely by you; rather, the intent is to
|
|
126
|
+
exercise the right to control the distribution of derivative or
|
|
127
|
+
collective works based on the Program.
|
|
128
|
+
|
|
129
|
+
In addition, mere aggregation of another work not based on the Program
|
|
130
|
+
with the Program (or with a work based on the Program) on a volume of
|
|
131
|
+
a storage or distribution medium does not bring the other work under
|
|
132
|
+
the scope of this License.
|
|
133
|
+
|
|
134
|
+
3. You may copy and distribute the Program (or a work based on it,
|
|
135
|
+
under Section 2) in object code or executable form under the terms of
|
|
136
|
+
Sections 1 and 2 above provided that you also do one of the following:
|
|
137
|
+
|
|
138
|
+
a) Accompany it with the complete corresponding machine-readable
|
|
139
|
+
source code, which must be distributed under the terms of Sections
|
|
140
|
+
1 and 2 above on a medium customarily used for software interchange; or,
|
|
141
|
+
|
|
142
|
+
b) Accompany it with a written offer, valid for at least three
|
|
143
|
+
years, to give any third party, for a charge no more than your
|
|
144
|
+
cost of physically performing source distribution, a complete
|
|
145
|
+
machine-readable copy of the corresponding source code, to be
|
|
146
|
+
distributed under the terms of Sections 1 and 2 above on a medium
|
|
147
|
+
customarily used for software interchange; or,
|
|
148
|
+
|
|
149
|
+
c) Accompany it with the information you received as to the offer
|
|
150
|
+
to distribute corresponding source code. (This alternative is
|
|
151
|
+
allowed only for noncommercial distribution and only if you
|
|
152
|
+
received the program in object code or executable form with such
|
|
153
|
+
an offer, in accord with Subsection b above.)
|
|
154
|
+
|
|
155
|
+
The source code for a work means the preferred form of the work for
|
|
156
|
+
making modifications to it. For an executable work, complete source
|
|
157
|
+
code means all the source code for all modules it contains, plus any
|
|
158
|
+
associated interface definition files, plus the scripts used to
|
|
159
|
+
control compilation and installation of the executable. However, as a
|
|
160
|
+
special exception, the source code distributed need not include
|
|
161
|
+
anything that is normally distributed (in either source or binary
|
|
162
|
+
form) with the major components (compiler, kernel, and so on) of the
|
|
163
|
+
operating system on which the executable runs, unless that component
|
|
164
|
+
itself accompanies the executable.
|
|
165
|
+
|
|
166
|
+
If distribution of executable or object code is made by offering
|
|
167
|
+
access to copy from a designated place, then offering equivalent
|
|
168
|
+
access to copy the source code from the same place counts as
|
|
169
|
+
distribution of the source code, even though third parties are not
|
|
170
|
+
compelled to copy the source along with the object code.
|
|
171
|
+
|
|
172
|
+
4. You may not copy, modify, sublicense, or distribute the Program
|
|
173
|
+
except as expressly provided under this License. Any attempt
|
|
174
|
+
otherwise to copy, modify, sublicense or distribute the Program is
|
|
175
|
+
void, and will automatically terminate your rights under this License.
|
|
176
|
+
However, parties who have received copies, or rights, from you under
|
|
177
|
+
this License will not have their licenses terminated so long as such
|
|
178
|
+
parties remain in full compliance.
|
|
179
|
+
|
|
180
|
+
5. You are not required to accept this License, since you have not
|
|
181
|
+
signed it. However, nothing else grants you permission to modify or
|
|
182
|
+
distribute the Program or its derivative works. These actions are
|
|
183
|
+
prohibited by law if you do not accept this License. Therefore, by
|
|
184
|
+
modifying or distributing the Program (or any work based on the
|
|
185
|
+
Program), you indicate your acceptance of this License to do so, and
|
|
186
|
+
all its terms and conditions for copying, distributing or modifying
|
|
187
|
+
the Program or works based on it.
|
|
188
|
+
|
|
189
|
+
6. Each time you redistribute the Program (or any work based on the
|
|
190
|
+
Program), the recipient automatically receives a license from the
|
|
191
|
+
original licensor to copy, distribute or modify the Program subject to
|
|
192
|
+
these terms and conditions. You may not impose any further
|
|
193
|
+
restrictions on the recipients' exercise of the rights granted herein.
|
|
194
|
+
You are not responsible for enforcing compliance by third parties to
|
|
195
|
+
this License.
|
|
196
|
+
|
|
197
|
+
7. If, as a consequence of a court judgment or allegation of patent
|
|
198
|
+
infringement or for any other reason (not limited to patent issues),
|
|
199
|
+
conditions are imposed on you (whether by court order, agreement or
|
|
200
|
+
otherwise) that contradict the conditions of this License, they do not
|
|
201
|
+
excuse you from the conditions of this License. If you cannot
|
|
202
|
+
distribute so as to satisfy simultaneously your obligations under this
|
|
203
|
+
License and any other pertinent obligations, then as a consequence you
|
|
204
|
+
may not distribute the Program at all. For example, if a patent
|
|
205
|
+
license would not permit royalty-free redistribution of the Program by
|
|
206
|
+
all those who receive copies directly or indirectly through you, then
|
|
207
|
+
the only way you could satisfy both it and this License would be to
|
|
208
|
+
refrain entirely from distribution of the Program.
|
|
209
|
+
|
|
210
|
+
If any portion of this section is held invalid or unenforceable under
|
|
211
|
+
any particular circumstance, the balance of the section is intended to
|
|
212
|
+
apply and the section as a whole is intended to apply in other
|
|
213
|
+
circumstances.
|
|
214
|
+
|
|
215
|
+
It is not the purpose of this section to induce you to infringe any
|
|
216
|
+
patents or other property right claims or to contest validity of any
|
|
217
|
+
such claims; this section has the sole purpose of protecting the
|
|
218
|
+
integrity of the free software distribution system, which is
|
|
219
|
+
implemented by public license practices. Many people have made
|
|
220
|
+
generous contributions to the wide range of software distributed
|
|
221
|
+
through that system in reliance on consistent application of that
|
|
222
|
+
system; it is up to the author/donor to decide if he or she is willing
|
|
223
|
+
to distribute software through any other system and a licensee cannot
|
|
224
|
+
impose that choice.
|
|
225
|
+
|
|
226
|
+
This section is intended to make thoroughly clear what is believed to
|
|
227
|
+
be a consequence of the rest of this License.
|
|
228
|
+
|
|
229
|
+
8. If the distribution and/or use of the Program is restricted in
|
|
230
|
+
certain countries either by patents or by copyrighted interfaces, the
|
|
231
|
+
original copyright holder who places the Program under this License
|
|
232
|
+
may add an explicit geographical distribution limitation excluding
|
|
233
|
+
those countries, so that distribution is permitted only in or among
|
|
234
|
+
countries not thus excluded. In such case, this License incorporates
|
|
235
|
+
the limitation as if written in the body of this License.
|
|
236
|
+
|
|
237
|
+
9. The Free Software Foundation may publish revised and/or new versions
|
|
238
|
+
of the General Public License from time to time. Such new versions will
|
|
239
|
+
be similar in spirit to the present version, but may differ in detail to
|
|
240
|
+
address new problems or concerns.
|
|
241
|
+
|
|
242
|
+
Each version is given a distinguishing version number. If the Program
|
|
243
|
+
specifies a version number of this License which applies to it and "any
|
|
244
|
+
later version", you have the option of following the terms and conditions
|
|
245
|
+
either of that version or of any later version published by the Free
|
|
246
|
+
Software Foundation. If the Program does not specify a version number of
|
|
247
|
+
this License, you may choose any version ever published by the Free Software
|
|
248
|
+
Foundation.
|
|
249
|
+
|
|
250
|
+
10. If you wish to incorporate parts of the Program into other free
|
|
251
|
+
programs whose distribution conditions are different, write to the author
|
|
252
|
+
to ask for permission. For software which is copyrighted by the Free
|
|
253
|
+
Software Foundation, write to the Free Software Foundation; we sometimes
|
|
254
|
+
make exceptions for this. Our decision will be guided by the two goals
|
|
255
|
+
of preserving the free status of all derivatives of our free software and
|
|
256
|
+
of promoting the sharing and reuse of software generally.
|
|
257
|
+
|
|
258
|
+
NO WARRANTY
|
|
259
|
+
|
|
260
|
+
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
|
261
|
+
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
|
262
|
+
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
|
263
|
+
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
|
264
|
+
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
265
|
+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
|
266
|
+
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
|
267
|
+
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
|
268
|
+
REPAIR OR CORRECTION.
|
|
269
|
+
|
|
270
|
+
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
271
|
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
|
272
|
+
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
|
273
|
+
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
|
274
|
+
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
|
275
|
+
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
|
276
|
+
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
|
277
|
+
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
|
278
|
+
POSSIBILITY OF SUCH DAMAGES.
|
|
279
|
+
|
|
280
|
+
END OF TERMS AND CONDITIONS
|
|
281
|
+
|
|
282
|
+
How to Apply These Terms to Your New Programs
|
|
283
|
+
|
|
284
|
+
If you develop a new program, and you want it to be of the greatest
|
|
285
|
+
possible use to the public, the best way to achieve this is to make it
|
|
286
|
+
free software which everyone can redistribute and change under these terms.
|
|
287
|
+
|
|
288
|
+
To do so, attach the following notices to the program. It is safest
|
|
289
|
+
to attach them to the start of each source file to most effectively
|
|
290
|
+
convey the exclusion of warranty; and each file should have at least
|
|
291
|
+
the "copyright" line and a pointer to where the full notice is found.
|
|
292
|
+
|
|
293
|
+
<one line to give the program's name and a brief idea of what it does.>
|
|
294
|
+
Copyright (C) <year> <name of author>
|
|
295
|
+
|
|
296
|
+
This program is free software; you can redistribute it and/or modify
|
|
297
|
+
it under the terms of the GNU General Public License as published by
|
|
298
|
+
the Free Software Foundation; either version 2 of the License, or
|
|
299
|
+
(at your option) any later version.
|
|
300
|
+
|
|
301
|
+
This program is distributed in the hope that it will be useful,
|
|
302
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
303
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
304
|
+
GNU General Public License for more details.
|
|
305
|
+
|
|
306
|
+
You should have received a copy of the GNU General Public License along
|
|
307
|
+
with this program; if not, see <https://www.gnu.org/licenses/>.
|
|
308
|
+
|
|
309
|
+
Also add information on how to contact you by electronic and paper mail.
|
|
310
|
+
|
|
311
|
+
If the program is interactive, make it output a short notice like this
|
|
312
|
+
when it starts in an interactive mode:
|
|
313
|
+
|
|
314
|
+
Gnomovision version 69, Copyright (C) year name of author
|
|
315
|
+
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
316
|
+
This is free software, and you are welcome to redistribute it
|
|
317
|
+
under certain conditions; type `show c' for details.
|
|
318
|
+
|
|
319
|
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
320
|
+
parts of the General Public License. Of course, the commands you use may
|
|
321
|
+
be called something other than `show w' and `show c'; they could even be
|
|
322
|
+
mouse-clicks or menu items--whatever suits your program.
|
|
323
|
+
|
|
324
|
+
You should also get your employer (if you work as a programmer) or your
|
|
325
|
+
school, if any, to sign a "copyright disclaimer" for the program, if
|
|
326
|
+
necessary. Here is a sample; alter the names:
|
|
327
|
+
|
|
328
|
+
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
|
329
|
+
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
|
330
|
+
|
|
331
|
+
<signature of Moe Ghoul>, 1 April 1989
|
|
332
|
+
Moe Ghoul, President of Vice
|
|
333
|
+
|
|
334
|
+
This General Public License does not permit incorporating your program into
|
|
335
|
+
proprietary programs. If your program is a subroutine library, you may
|
|
336
|
+
consider it more useful to permit linking proprietary applications with the
|
|
337
|
+
library. If this is what you want to do, use the GNU Lesser General
|
|
338
|
+
Public License instead of this License.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: machinome-node-build123d
|
|
3
|
+
Version: 0.9.0
|
|
4
|
+
Summary: The build123d node types of Machinome, and the reducer of its SVG artwork
|
|
5
|
+
Author-email: Luis Fagundes <lhfagundes@gmail.com>
|
|
6
|
+
License-Expression: GPL-2.0-or-later OR CERN-OHL-S-2.0+
|
|
7
|
+
Project-URL: Homepage, https://github.com/machinome/machinome
|
|
8
|
+
Keywords: machinome
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Natural Language :: English
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Requires-Python: >=3.11
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
License-File: LICENSES/CERN-OHL-S-2.0.txt
|
|
19
|
+
License-File: LICENSES/GPL-2.0-or-later.txt
|
|
20
|
+
Requires-Dist: machinome~=0.9.0
|
|
21
|
+
Requires-Dist: build123d==0.10.*
|
|
22
|
+
Requires-Dist: ocp-gordon<0.3,>=0.2.2
|
|
23
|
+
Requires-Dist: machinome-engine-brep~=0.9.0
|
|
24
|
+
Requires-Dist: numpy
|
|
25
|
+
Dynamic: license-file
|
|
26
|
+
|
|
27
|
+
# machinome-node-build123d
|
|
28
|
+
|
|
29
|
+
The build123d node types of [Machinome](https://github.com/machinome/machinome):
|
|
30
|
+
the module `machinome.node.build123d`, whose `Build123dNode` is a part
|
|
31
|
+
modelled with [build123d](https://build123d.readthedocs.io) and whose
|
|
32
|
+
`Build123dSheetNode` is a sheet part cut from an authored profile, both
|
|
33
|
+
B-rep geometry on the framework's B-rep engine. It also reduces the SVG
|
|
34
|
+
artwork of a part's markings.
|
|
35
|
+
|
|
36
|
+
## Install
|
|
37
|
+
|
|
38
|
+
pip install "machinome[build123d]"
|
|
39
|
+
|
|
40
|
+
## Manual
|
|
41
|
+
|
|
42
|
+
<https://machinome.readthedocs.io>
|
|
43
|
+
|
|
44
|
+
## Licence
|
|
45
|
+
|
|
46
|
+
GPL-2.0-or-later or CERN-OHL-S-2.0-or-later, at the recipient's choice; the
|
|
47
|
+
texts are in `LICENSE` and `LICENSES/`.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# machinome-node-build123d
|
|
2
|
+
|
|
3
|
+
The build123d node types of [Machinome](https://github.com/machinome/machinome):
|
|
4
|
+
the module `machinome.node.build123d`, whose `Build123dNode` is a part
|
|
5
|
+
modelled with [build123d](https://build123d.readthedocs.io) and whose
|
|
6
|
+
`Build123dSheetNode` is a sheet part cut from an authored profile, both
|
|
7
|
+
B-rep geometry on the framework's B-rep engine. It also reduces the SVG
|
|
8
|
+
artwork of a part's markings.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
pip install "machinome[build123d]"
|
|
13
|
+
|
|
14
|
+
## Manual
|
|
15
|
+
|
|
16
|
+
<https://machinome.readthedocs.io>
|
|
17
|
+
|
|
18
|
+
## Licence
|
|
19
|
+
|
|
20
|
+
GPL-2.0-or-later or CERN-OHL-S-2.0-or-later, at the recipient's choice; the
|
|
21
|
+
texts are in `LICENSE` and `LICENSES/`.
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
# Machinome - A framework for mechanical CAD projects
|
|
2
|
+
# Copyright (C) 2023-2026 Luis Henrique Cassis Fagundes
|
|
3
|
+
# SPDX-License-Identifier: GPL-2.0-or-later OR CERN-OHL-S-2.0+
|
|
4
|
+
|
|
5
|
+
"""The build123d leaves: `Build123dNode`, `Build123dSheetNode`, and the
|
|
6
|
+
reducer of `Svg` artwork.
|
|
7
|
+
|
|
8
|
+
One module per technology (the `node-model` capability): both node types
|
|
9
|
+
and the artwork reducer drive the one kernel, build123d, so they share one
|
|
10
|
+
address, `machinome.node.build123d`, and one extra, `machinome[build123d]`.
|
|
11
|
+
They stay distinct types -- a `Build123dNode` renders a solid it authored,
|
|
12
|
+
a sheet part's solid is derived from its authored profile.
|
|
13
|
+
|
|
14
|
+
build123d itself is imported inside the functions that use it, never at
|
|
15
|
+
import: importing build123d costs about 2.4 seconds, which a project that
|
|
16
|
+
names this module only to declare a node, or never builds an artwork,
|
|
17
|
+
should not pay.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
import logging
|
|
21
|
+
|
|
22
|
+
from machinome.engine import require_brep_engine
|
|
23
|
+
from machinome.extras import require_extra
|
|
24
|
+
from machinome.node.brep_leaf import BrepLeafNode
|
|
25
|
+
from machinome.node.sheet_leaf import SheetLeafNode
|
|
26
|
+
|
|
27
|
+
# Refused here, without the `build123d` extra, by the line that installs
|
|
28
|
+
# it; the check imports nothing.
|
|
29
|
+
require_extra('build123d',
|
|
30
|
+
'machinome.node.build123d (Build123dNode, Build123dSheetNode, '
|
|
31
|
+
'the Svg artwork reducer)',
|
|
32
|
+
'build123d')
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def build123d_shape(rendered):
|
|
36
|
+
"""The kernel shape of a build123d render result, or None if
|
|
37
|
+
``rendered`` did not come from build123d.
|
|
38
|
+
|
|
39
|
+
build123d is a front end over OCCT: every object of it wraps a single
|
|
40
|
+
TopoDS_Shape, exposed as ``.wrapped``, which is the B-rep engine's
|
|
41
|
+
currency itself (ADR-160). Taking that shape is therefore the whole
|
|
42
|
+
conversion, and every consumer after it -- placement, fuse, common,
|
|
43
|
+
BREP persistence, volume -- needs no backend special case, so a fusion
|
|
44
|
+
may freely mix build123d with any other B-rep backend.
|
|
45
|
+
|
|
46
|
+
build123d is recognised by module name rather than imported.
|
|
47
|
+
``machinome.node`` imports no node type's module, each is imported
|
|
48
|
+
only when a project imports it, and importing build123d costs about 1.6
|
|
49
|
+
seconds, which a project modelling in another backend should not pay.
|
|
50
|
+
|
|
51
|
+
A builder is not itself geometry: ``with BuildPart() as part:`` is
|
|
52
|
+
build123d's headline idiom, and returning the builder rather than its
|
|
53
|
+
``.part`` is the first mistake a user makes, so the finished part is
|
|
54
|
+
taken. Returning None rather than raising leaves the diagnosis to
|
|
55
|
+
Build123dNode.validate(), which can name the node.
|
|
56
|
+
"""
|
|
57
|
+
if not type(rendered).__module__.startswith('build123d'):
|
|
58
|
+
return None
|
|
59
|
+
if not hasattr(rendered, 'wrapped'):
|
|
60
|
+
rendered = getattr(rendered, 'part', None)
|
|
61
|
+
return getattr(rendered, 'wrapped', None)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class Build123dNode(BrepLeafNode):
|
|
65
|
+
"""
|
|
66
|
+
Represents a 3D object created using the build123d tool.
|
|
67
|
+
|
|
68
|
+
build123d is a boundary-representation backend over the same OCCT that
|
|
69
|
+
CadQueryNode uses, so the B-rep leaf contract -- brep, shape(),
|
|
70
|
+
present() -- is BrepLeafNode's. What is build123d's own is the namespace
|
|
71
|
+
and the solid-shaped-result rule below.
|
|
72
|
+
|
|
73
|
+
Note that this module never imports build123d. See build123d_shape().
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
namespace = 'build123d'
|
|
77
|
+
|
|
78
|
+
def shape_from_rendered(self, rendered):
|
|
79
|
+
return build123d_shape(rendered)
|
|
80
|
+
|
|
81
|
+
def validate(self, rendered):
|
|
82
|
+
"""Reject anything but a solid, on top of the inherited list and
|
|
83
|
+
namespace checks.
|
|
84
|
+
|
|
85
|
+
The namespace cannot carry this adapter alone. build123d's solids,
|
|
86
|
+
sketches and curves are all under the `build123d` namespace -- Part
|
|
87
|
+
and Compound in build123d.topology.composite, Solid in
|
|
88
|
+
build123d.topology.three_d, but also Rectangle in
|
|
89
|
+
build123d.objects_sketch and Line in build123d.objects_curve -- so
|
|
90
|
+
`namespace` admits a sketch as readily as a part. Left to itself, a
|
|
91
|
+
returned sketch would fail later and far less legibly, inside the STL
|
|
92
|
+
export.
|
|
93
|
+
|
|
94
|
+
The check stays here rather than on BrepLeafNode because it is not
|
|
95
|
+
the B-rep leaf contract's: a CadQuery render is legitimately a
|
|
96
|
+
Workplane, which is not a solid until shape_from_rendered unwraps
|
|
97
|
+
it. The solids are counted by the B-rep engine.
|
|
98
|
+
"""
|
|
99
|
+
super().validate(rendered)
|
|
100
|
+
|
|
101
|
+
shape = build123d_shape(rendered)
|
|
102
|
+
if shape is None or not require_brep_engine(
|
|
103
|
+
f'B-rep leaf {self.name}',
|
|
104
|
+
'its render result is checked for a solid'
|
|
105
|
+
).solid_count(shape):
|
|
106
|
+
raise Exception(
|
|
107
|
+
f"{self.name} is a Build123dNode and should render a "
|
|
108
|
+
f"build123d solid -- a Part, Solid or Compound, or a builder "
|
|
109
|
+
f"whose .part is one -- not {type(rendered).__name__}"
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
# How far off the XY plane a profile may sit and still count as on it.
|
|
114
|
+
# Loose enough for the rounding a placement composes, tight enough that a
|
|
115
|
+
# profile authored on another plane is caught.
|
|
116
|
+
_PLANE_TOLERANCE = 1e-6
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
def _export_dxf(face, path):
|
|
120
|
+
"""Write one validated planar face as a nominal cut file at `path`.
|
|
121
|
+
|
|
122
|
+
Nominal: the authored profile at model scale, in millimeters, with no
|
|
123
|
+
kerf or other machine compensation. Compensation is a property of a
|
|
124
|
+
machine and a material, not of the part, and the persisted BREP keeps
|
|
125
|
+
the exact profile available to a future offsetting exporter.
|
|
126
|
+
|
|
127
|
+
build123d's own DXF exporter is used rather than a tessellation, so a
|
|
128
|
+
circular hole reaches the cutter as a circle at its modelled radius
|
|
129
|
+
instead of a polygon that would cut tight.
|
|
130
|
+
|
|
131
|
+
Deliberately a private, single-purpose function rather than a method:
|
|
132
|
+
it converts a validated face to a file and knows nothing about nodes,
|
|
133
|
+
so a second sheet backend can be given its own without either growing
|
|
134
|
+
a backend switch (ADR-047's pattern). It writes bytes and nothing else:
|
|
135
|
+
the sheet base publishes the file, stamped and recorded, through
|
|
136
|
+
`publish_artifact` -- what is written is build123d's business, how it
|
|
137
|
+
is published the core's.
|
|
138
|
+
"""
|
|
139
|
+
import build123d as b3d
|
|
140
|
+
|
|
141
|
+
exporter = b3d.ExportDXF(unit=b3d.Unit.MM)
|
|
142
|
+
exporter.add_shape(face)
|
|
143
|
+
exporter.write(path)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
class Build123dSheetNode(SheetLeafNode):
|
|
147
|
+
"""A sheet part authored as a build123d profile.
|
|
148
|
+
|
|
149
|
+
The whole adapter is the backend-specific hooks SheetLeafNode declares
|
|
150
|
+
-- reduce a profile result to its planar faces, say whether a face lies
|
|
151
|
+
on the XY plane, extrude it, write it as a cut file. The contract around
|
|
152
|
+
them is the sheet base's, and the B-rep leaf contract under that is
|
|
153
|
+
BrepLeafNode's: the
|
|
154
|
+
extrusion is an ordinary build123d Part, so namespace validation,
|
|
155
|
+
the rewrap to the engine's currency, and the STL/BREP writes are the
|
|
156
|
+
ones every other B-rep adapter already goes through.
|
|
157
|
+
|
|
158
|
+
This is not a Build123dNode, though both are defined in this module.
|
|
159
|
+
Both drive build123d, but a Build123dNode renders a solid it authored,
|
|
160
|
+
while a sheet part's solid is derived and only its profile is
|
|
161
|
+
authored -- and the two must stay distinct types, since `isinstance`
|
|
162
|
+
distinguishes them that way.
|
|
163
|
+
|
|
164
|
+
Like Build123dNode, it imports build123d only inside the hooks that use
|
|
165
|
+
it, never at import time.
|
|
166
|
+
"""
|
|
167
|
+
|
|
168
|
+
namespace = 'build123d'
|
|
169
|
+
|
|
170
|
+
def profile(self):
|
|
171
|
+
"""The part's cut profile: a build123d `Sketch`, a `Face`, or a
|
|
172
|
+
`BuildSketch` builder holding one."""
|
|
173
|
+
raise NotImplementedError(
|
|
174
|
+
f"{self.__class__} is a Build123dSheetNode and must implement "
|
|
175
|
+
"profile(), returning a build123d sketch, face or BuildSketch")
|
|
176
|
+
|
|
177
|
+
def profile_faces(self, profile):
|
|
178
|
+
"""The planar faces of a build123d profile result.
|
|
179
|
+
|
|
180
|
+
Empty for anything that is not a planar 2D object, so the sheet
|
|
181
|
+
base can name the type the node produced: a solid has solids, a
|
|
182
|
+
curve has no faces at all, and a foreign object is not build123d's.
|
|
183
|
+
A solid is the interesting rejection -- Build123dNode would accept
|
|
184
|
+
it, and its six planar faces would otherwise read as six parts.
|
|
185
|
+
|
|
186
|
+
A builder is not itself geometry. `with BuildSketch() as sketch:`
|
|
187
|
+
is build123d's headline sketch idiom, so the finished `.sketch` is
|
|
188
|
+
taken, exactly as Build123dNode takes a builder's `.part`.
|
|
189
|
+
"""
|
|
190
|
+
if not type(profile).__module__.startswith('build123d'):
|
|
191
|
+
return []
|
|
192
|
+
if not hasattr(profile, 'wrapped'):
|
|
193
|
+
profile = getattr(profile, 'sketch', None)
|
|
194
|
+
if getattr(profile, 'wrapped', None) is None:
|
|
195
|
+
return []
|
|
196
|
+
if profile.solids() or profile.shells():
|
|
197
|
+
return []
|
|
198
|
+
return [face for face in profile.faces() if face.is_planar]
|
|
199
|
+
|
|
200
|
+
def lies_on_xy_plane(self, face):
|
|
201
|
+
normal = face.normal_at()
|
|
202
|
+
if abs(abs(normal.Z) - 1) > _PLANE_TOLERANCE:
|
|
203
|
+
return False
|
|
204
|
+
box = face.bounding_box()
|
|
205
|
+
return (abs(box.min.Z) <= _PLANE_TOLERANCE
|
|
206
|
+
and abs(box.max.Z) <= _PLANE_TOLERANCE)
|
|
207
|
+
|
|
208
|
+
def extrude(self, face):
|
|
209
|
+
"""The profile swept along +Z by the thickness.
|
|
210
|
+
|
|
211
|
+
The direction is given explicitly rather than left to the face's
|
|
212
|
+
own normal, so a profile authored with a reversed normal still
|
|
213
|
+
yields the part the contract promises: from the XY plane up to
|
|
214
|
+
Z = thickness.
|
|
215
|
+
"""
|
|
216
|
+
import build123d as b3d
|
|
217
|
+
|
|
218
|
+
return b3d.extrude(face, amount=self.thickness, dir=(0, 0, 1))
|
|
219
|
+
|
|
220
|
+
def write_dxf(self, face, path):
|
|
221
|
+
_export_dxf(face, path)
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
##############################################
|
|
225
|
+
# The reducer of `Svg` artwork
|
|
226
|
+
|
|
227
|
+
#: The artwork reducer contract version this module implements. The markings
|
|
228
|
+
#: module (`machinome.node.markings`) declares the version it speaks and
|
|
229
|
+
#: refuses this module when the two differ (ADR-162's pattern).
|
|
230
|
+
SVG_REDUCER_CONTRACT = 1
|
|
231
|
+
|
|
232
|
+
#: The reduction's one log line keeps the logger it was written under, so a
|
|
233
|
+
#: build's log reads as it did before the reducer moved here.
|
|
234
|
+
logger = logging.getLogger('node.markings')
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
def svg_regions(path) -> list:
|
|
238
|
+
"""The drawing's CLOSED regions, each one build123d face carrying its
|
|
239
|
+
enclosed regions as holes.
|
|
240
|
+
|
|
241
|
+
The file's own origin is kept (`align=None`) rather than moved to the
|
|
242
|
+
drawing's minimum corner, which is what makes a marking's `origin=`
|
|
243
|
+
meaningful and what makes two artworks authored on one sheet register
|
|
244
|
+
with each other. Its Y axis is flipped into model orientation
|
|
245
|
+
(`flip_y=True`, build123d's default), because SVG's Y grows downward and
|
|
246
|
+
the model's does not -- so a drawing authored in a drawing program reads
|
|
247
|
+
the right way up and its faces sit at negative Y.
|
|
248
|
+
|
|
249
|
+
Open paths are ignored and COUNTED, in one line at INFO naming the file:
|
|
250
|
+
a drawing's sheet border is an open path that registers the artwork and
|
|
251
|
+
is not part of it -- the Curta's own `results_dial.svg` carries a border
|
|
252
|
+
that measures its roll's unwrapped circumference exactly -- and dropping
|
|
253
|
+
it silently would leave a modeller wondering why the digits do not sit
|
|
254
|
+
where the drawing says. Artwork with no closed region at all is refused:
|
|
255
|
+
a decal with nothing in it is a mistake, not an empty decal.
|
|
256
|
+
"""
|
|
257
|
+
import build123d as b3d
|
|
258
|
+
|
|
259
|
+
shapes = b3d.import_svg(path, align=None)
|
|
260
|
+
faces = [shape for shape in shapes if isinstance(shape, b3d.Face)]
|
|
261
|
+
ignored = len(shapes) - len(faces)
|
|
262
|
+
logger.info('%s: %d open path(s) ignored, %d closed region(s) read',
|
|
263
|
+
path, ignored, len(faces))
|
|
264
|
+
if not faces:
|
|
265
|
+
raise ValueError(
|
|
266
|
+
f'{path} holds no closed region: a marking is the drawing\'s '
|
|
267
|
+
f'closed regions, and this file has none -- every path in it '
|
|
268
|
+
f'is open. Close the outlines the marking is meant to carry.')
|
|
269
|
+
return faces
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
def svg_triangles(path, tolerance):
|
|
273
|
+
"""The artwork at `path` as flat triangles, unscaled: `(vertices,
|
|
274
|
+
triangles)`, the vertices an `(N, 2)` array of artwork coordinates and
|
|
275
|
+
the triangles an `(M, 3)` array of indices into them.
|
|
276
|
+
|
|
277
|
+
Each region is oriented to `+Z` before it is meshed, so the triangles'
|
|
278
|
+
winding is a property of THIS PRODUCER and not of the drawing tool or of
|
|
279
|
+
a transitive dependency's fix-up pass: the markings' placement maths
|
|
280
|
+
maps artwork `+Z` outward by construction -- `Flat` builds its frame so
|
|
281
|
+
`x_axis x y_axis` is the declared normal, and `Wrapped` maps artwork
|
|
282
|
+
`(u, v)` so its tangents' cross product is the outward radial direction
|
|
283
|
+
-- so orienting the artwork here is what makes the built decal face away
|
|
284
|
+
from the part, whichever way the artwork's own regions came out of the
|
|
285
|
+
drawing.
|
|
286
|
+
|
|
287
|
+
Each region is then meshed in its own plane through OCCT's incremental
|
|
288
|
+
mesher, which respects the holes the face carries, so a digit's counter
|
|
289
|
+
is a hole in the decal and not a second patch of colour over it. The
|
|
290
|
+
artwork's `scale` is the file's property and is the caller's to apply.
|
|
291
|
+
"""
|
|
292
|
+
import build123d as b3d
|
|
293
|
+
import numpy as np
|
|
294
|
+
|
|
295
|
+
vertices = []
|
|
296
|
+
triangles = []
|
|
297
|
+
for face in svg_regions(path):
|
|
298
|
+
if face.normal_at().Z < 0:
|
|
299
|
+
face = b3d.Face(face.wrapped.Complemented())
|
|
300
|
+
points, facets = face.tessellate(tolerance)
|
|
301
|
+
offset = len(vertices)
|
|
302
|
+
vertices.extend((point.X, point.Y) for point in points)
|
|
303
|
+
triangles.extend((a + offset, b + offset, c + offset)
|
|
304
|
+
for a, b, c in facets)
|
|
305
|
+
return (np.array(vertices, dtype=float),
|
|
306
|
+
np.array(triangles, dtype=np.int64))
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: machinome-node-build123d
|
|
3
|
+
Version: 0.9.0
|
|
4
|
+
Summary: The build123d node types of Machinome, and the reducer of its SVG artwork
|
|
5
|
+
Author-email: Luis Fagundes <lhfagundes@gmail.com>
|
|
6
|
+
License-Expression: GPL-2.0-or-later OR CERN-OHL-S-2.0+
|
|
7
|
+
Project-URL: Homepage, https://github.com/machinome/machinome
|
|
8
|
+
Keywords: machinome
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Natural Language :: English
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Requires-Python: >=3.11
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
License-File: LICENSES/CERN-OHL-S-2.0.txt
|
|
19
|
+
License-File: LICENSES/GPL-2.0-or-later.txt
|
|
20
|
+
Requires-Dist: machinome~=0.9.0
|
|
21
|
+
Requires-Dist: build123d==0.10.*
|
|
22
|
+
Requires-Dist: ocp-gordon<0.3,>=0.2.2
|
|
23
|
+
Requires-Dist: machinome-engine-brep~=0.9.0
|
|
24
|
+
Requires-Dist: numpy
|
|
25
|
+
Dynamic: license-file
|
|
26
|
+
|
|
27
|
+
# machinome-node-build123d
|
|
28
|
+
|
|
29
|
+
The build123d node types of [Machinome](https://github.com/machinome/machinome):
|
|
30
|
+
the module `machinome.node.build123d`, whose `Build123dNode` is a part
|
|
31
|
+
modelled with [build123d](https://build123d.readthedocs.io) and whose
|
|
32
|
+
`Build123dSheetNode` is a sheet part cut from an authored profile, both
|
|
33
|
+
B-rep geometry on the framework's B-rep engine. It also reduces the SVG
|
|
34
|
+
artwork of a part's markings.
|
|
35
|
+
|
|
36
|
+
## Install
|
|
37
|
+
|
|
38
|
+
pip install "machinome[build123d]"
|
|
39
|
+
|
|
40
|
+
## Manual
|
|
41
|
+
|
|
42
|
+
<https://machinome.readthedocs.io>
|
|
43
|
+
|
|
44
|
+
## Licence
|
|
45
|
+
|
|
46
|
+
GPL-2.0-or-later or CERN-OHL-S-2.0-or-later, at the recipient's choice; the
|
|
47
|
+
texts are in `LICENSE` and `LICENSES/`.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
LICENSES/CERN-OHL-S-2.0.txt
|
|
5
|
+
LICENSES/GPL-2.0-or-later.txt
|
|
6
|
+
machinome/node/build123d.py
|
|
7
|
+
machinome_node_build123d.egg-info/PKG-INFO
|
|
8
|
+
machinome_node_build123d.egg-info/SOURCES.txt
|
|
9
|
+
machinome_node_build123d.egg-info/dependency_links.txt
|
|
10
|
+
machinome_node_build123d.egg-info/requires.txt
|
|
11
|
+
machinome_node_build123d.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
machinome
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "machinome-node-build123d"
|
|
7
|
+
version = "0.9.0"
|
|
8
|
+
description = "The build123d node types of Machinome, and the reducer of its SVG artwork"
|
|
9
|
+
readme = { file = "README.md", content-type = "text/markdown" }
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
license = "GPL-2.0-or-later OR CERN-OHL-S-2.0+"
|
|
12
|
+
license-files = ["LICENSE", "LICENSES/*.txt"]
|
|
13
|
+
authors = [
|
|
14
|
+
{ name = "Luis Fagundes", email = "lhfagundes@gmail.com" },
|
|
15
|
+
]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Natural Language :: English",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
]
|
|
24
|
+
keywords = ["machinome"]
|
|
25
|
+
dependencies = [
|
|
26
|
+
# The core this node type is a portion of, released with it: the set
|
|
27
|
+
# carries one version, and the pins between its packages are ~= both
|
|
28
|
+
# ways.
|
|
29
|
+
"machinome~=0.9.0",
|
|
30
|
+
# The newest build123d whose OCP is the one cadquery 2.7 binds
|
|
31
|
+
# (machinome-node-cadquery's manifest says why the pair).
|
|
32
|
+
"build123d==0.10.*",
|
|
33
|
+
# build123d 0.10 leaves this transitive dependency unbounded; 0.3
|
|
34
|
+
# imports OCP 8 collections absent from our shared OCP 7.8 runtime.
|
|
35
|
+
"ocp-gordon>=0.2.2,<0.3",
|
|
36
|
+
# The B-rep engine, which turns a render result into B-rep geometry and
|
|
37
|
+
# states the OCCT range, once.
|
|
38
|
+
"machinome-engine-brep~=0.9.0",
|
|
39
|
+
# Arrays, imported by the artwork reducer; the core pins the range.
|
|
40
|
+
"numpy",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
[project.urls]
|
|
44
|
+
Homepage = "https://github.com/machinome/machinome"
|
|
45
|
+
|
|
46
|
+
[tool.setuptools.packages.find]
|
|
47
|
+
# The portion, machinome/node/build123d.py, with no __init__.py at either
|
|
48
|
+
# level, so the core's package path admits it.
|
|
49
|
+
include = ["machinome.node"]
|
|
50
|
+
namespaces = true
|