kcl-lib 0.2.147

KittyCAD Language implementation and tools
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
/// This module contains functions for transforming sketches and solids.

@no_std
@settings(defaultLengthUnit = mm, kclVersion = 1.0, experimentalFeatures = allow)

import Axis3d from "std::types"

/// Mirror a sketch.
///
/// Mirror occurs around a local sketch axis rather than a global axis.
///
/// ```kcl,legacySketch
/// // Mirror an un-closed sketch across the Y axis.
/// sketch001 = startSketchOn(XZ)
///     |> startProfile(at = [0, 10])
///     |> line(end = [15, 0])
///     |> line(end = [-7, -3])
///     |> line(end = [9, -1])
///     |> line(end = [-8, -5])
///     |> line(end = [9, -3])
///     |> line(end = [-8, -3])
///     |> line(end = [9, -1])
///     |> line(end = [-19, -0])
///     |> mirror2d(axis = Y)
///
/// example = extrude(sketch001, length = 10)
/// ```
///
/// ```kcl,legacySketch
/// // Mirror a un-closed sketch across the Y axis.
/// sketch001 = startSketchOn(XZ)
///     |> startProfile(at = [0, 8.5])
///     |> line(end = [20, -8.5])
///     |> line(end = [-20, -8.5])
///     |> mirror2d(axis = Y)
///
/// example = extrude(sketch001, length = 10)
/// ```
///
/// ```kcl,legacySketch
/// // Mirror a un-closed sketch across an edge.
/// helper001 = startSketchOn(XZ)
///  |> startProfile(at = [0, 0])
///  |> line(end = [0, 10], tag = $edge001)
///
/// sketch001 = startSketchOn(XZ)
///     |> startProfile(at = [0, 8.5])
///     |> line(end = [20, -8.5])
///     |> line(end = [-20, -8.5])
///     |> mirror2d(axis = edge001)
///
/// // example = extrude(sketch001, length = 10)
/// ```
///
/// ```kcl,sketchSolve
/// // Mirror an un-closed sketch across a line from a sketch block.
/// helper001 = sketch(on = XZ) {
///   line1 = line(start = [var 0mm, var 0mm], end = [var 0mm, var 10mm])
/// }
///
/// sketch001 = startSketchOn(XZ)
///     |> startProfile(at = [0, 8.5])
///     |> line(end = [20, -8.5])
///     |> line(end = [-20, -8.5])
///     |> mirror2d(axis = helper001.line1)
///
/// // example = extrude(sketch001, length = 10)
/// ```
///
/// ```kcl,legacySketch
/// // Mirror an un-closed sketch across a custom axis.
/// sketch001 = startSketchOn(XZ)
///     |> startProfile(at = [0, 8.5])
///     |> line(end = [20, -8.5])
///     |> line(end = [-20, -8.5])
///     |> mirror2d(
///       axis = {
///         direction = [0.0, 1.0],
///         origin = [0.0, 0.0]
///       })
///
/// example = extrude(sketch001, length = 10)
/// ```
///
/// ```kcl,legacySketch
/// // Sketch on the face of a mirrored sketch, that has been extruded.
/// sketch0011 = startSketchOn(XY)
///      |> startProfile(at = [6.77, 0])
///      |> yLine(length = 1.27)
///      |> tangentialArc(endAbsolute = [5.96, 2.37])
///      |> tangentialArc(endAbsolute = [-6.2, 2.44])
///      |> tangentialArc(endAbsolute = [-6.6, 1.82])
///      |> yLine(length = -1.82)
///      |> mirror2d( axis = X )
///      |> extrude(length = 10)
///
/// sketch002 = startSketchOn(sketch0011, face = END)
///     |> circle( center = [-0.01, 1.58], radius = 1.2 )
///     |> extrude(length = 1.2)
///
/// shell([sketch002], faces = ['end'], thickness = .1 )
/// ```
@(impl = std_rust, feature_tree = true)
export fn mirror2d(
  /// The sketch or sketches to be reflected.
  @sketches: [Sketch; 1+],
  /// The axis to reflect around.
  axis: Axis2d | Edge | Segment,
): Sketch {}

/// Move a solid or a sketch.
///
/// This is really useful for assembling parts together. You can create a part
/// and then move it to the correct location.
///
/// By default, this does a local translation, around the sketch/body's coordinate system.
/// To translate around the global scene coordinate system, use `global = true`.
///
/// Translate is really useful for sketches if you want to move a sketch
/// and then rotate it using the `rotate` function to create a loft.
///
/// ```kcl,legacySketch
/// // Move a pipe.
///
/// // Create a path for the sweep.
/// sweepPath = startSketchOn(XZ)
///     |> startProfile(at = [0.05, 0.05])
///     |> line(end = [0, 7])
///     |> tangentialArc(angle = 90deg, radius = 5)
///     |> line(end = [-3, 0])
///     |> tangentialArc(angle = -90deg, radius = 5)
///     |> line(end = [0, 7])
///
/// // Create a hole for the pipe.
/// pipeHole = startSketchOn(XY)
///     |> circle(
///         center = [0, 0],
///         radius = 1.5,
///     )
///
/// sweepSketch = startSketchOn(XY)
///     |> circle(
///         center = [0, 0],
///         radius = 2,
///         )              
///     |> subtract2d(tool = pipeHole)
///     |> sweep(path = sweepPath)   
///     |> translate(
///         x = 1.0,
///         y = 1.0,
///         z = 2.5,
///     )
/// ```
///
/// ```kcl,legacySketch
/// // Move an imported model.
///
/// import "tests/inputs/cube.sldprt" as cube
///
/// // Circle so you actually see the move.
/// startSketchOn(XY)
///     |> circle(
///         center = [-10, -10],
///         radius = 10,
///         )
///     |> extrude(
///     length = 10,
///     )
///
/// cube
///     |> translate(
///     x = 10.0,
///     y = 10.0,
///     z = 2.5,
///     )
/// ```
///
/// ```kcl,legacySketch
/// // Move an imported model.
///
/// import "tests/inputs/cube.sldprt" as cube
///
/// // Circle so you actually see the move.
/// startSketchOn(XY)
///     |> circle(
///         center = [-10, -10],
///         radius = 10,
///         )
///     |> extrude(
///     length = 10,
///     )
///
/// cube
///     |> translate(xyz = [10.0, 10.0, 2.5])
/// ```
///
/// ```kcl,legacySketch
/// // Sweep two sketches along the same path.
///
/// sketch001 = startSketchOn(XY)
/// rectangleSketch = startProfile(sketch001, at = [-200, 23.86])
///     |> angledLine(angle = 0, length = 73.47, tag = $rectangleSegmentA001)
///     |> angledLine(
///         angle = segAng(rectangleSegmentA001) - 90deg,
///         length = 50.61,
///     )
///     |> angledLine(
///         angle = segAng(rectangleSegmentA001),
///         length = -segLen(rectangleSegmentA001),
///     )
///     |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
///     |> close()
///
/// circleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)
///
/// sketch002 = startSketchOn(YZ)
/// sweepPath = startProfile(sketch002, at = [0, 0])
///     |> yLine(length = 231.81)
///     |> tangentialArc(radius = 80, angle = -90deg)
///     |> xLine(length = 384.93)
///
/// parts = sweep([rectangleSketch, circleSketch], path = sweepPath)
///
/// // Move the sweeps.
/// translate(parts, x = 1.0, y = 1.0, z = 2.5)
/// ```
///
/// ```kcl,legacySketch
/// // Move a sketch.
///
/// fn square(@length){
///     l = length / 2
///     p0 = [-l, -l]
///     p1 = [-l, l]
///     p2 = [l, l]
///     p3 = [l, -l]
///
///     return startSketchOn(XY)
///         |> startProfile(at = p0)
///         |> line(endAbsolute = p1)
///         |> line(endAbsolute = p2)
///         |> line(endAbsolute = p3)
///         |> close()
/// }
///
/// square(10)
///     |> translate(
///         x = 5,
///         y = 5,
///     )
///     |> extrude(
///         length = 10,
///     )
/// ```
///
/// ```kcl,legacySketch
/// // Translate and rotate a sketch to create a loft.
/// sketch001 = startSketchOn(XY)
///
/// fn square() {
///     return  startProfile(sketch001, at = [-10, 10])
///         |> xLine(length = 20)
///         |> yLine(length = -20)
///         |> xLine(length = -20)
///         |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
///         |> close()
/// }
///
/// profile001 = square()
///
/// profile002 = square()
///     |> translate(z = 20)
///     |> rotate(axis = [0, 0, 1.0], angle = 45deg)
///
/// loft([profile001, profile002])
/// ```
@(impl = std_rust, feature_tree = true)
export fn translate(
  /// The solid, sketch, or set of solids or sketches to move.
  @objects: [Solid; 1+] | [Sketch; 1+] | ImportedGeometry,
  /// The amount to move the solid or sketch along the x axis.
  @(includeInSnippet = true)
  x?: number(Length) = 0,
  /// The amount to move the solid or sketch along the y axis.
  @(includeInSnippet = true)
  y?: number(Length) = 0,
  /// The amount to move the solid or sketch along the z axis.
  @(includeInSnippet = true)
  z?: number(Length) = 0,
  /// If true, the transform is applied in global space. The origin of the model will move. By default, the transform is applied in local sketch axis, therefore the origin will not move.
  global?: bool = false,  
  /// If given, interpret this point as 3 distances, along each of [X, Y, Z] and translate by each of them.
  xyz?: [number(Length); 3]
): [Solid; 1+] | [Sketch; 1+] | ImportedGeometry {}

/// Rotate a solid or a sketch.
///
/// This is really useful for assembling parts together. You can create a part
/// and then rotate it to the correct orientation.
///
/// For sketches, you can use this to rotate a sketch and then loft it with another sketch.
///
/// By default, this does a local rotation, around the sketch/body's center.
/// To rotate around the global scene coordinates, use `global = true`.
///
/// ### Using Roll, Pitch, and Yaw
///
/// When rotating a part in 3D space, "roll," "pitch," and "yaw" refer to the
/// three rotational axes used to describe its orientation: roll is rotation
/// around the longitudinal axis (front-to-back), pitch is rotation around the
/// lateral axis (wing-to-wing), and yaw is rotation around the vertical axis
/// (up-down); essentially, it's like tilting the part on its side (roll),
/// tipping the nose up or down (pitch), and turning it left or right (yaw).
///
/// So, in the context of a 3D model:
///
/// - **Roll**: Imagine spinning a pencil on its tip - that's a roll movement.
///
/// - **Pitch**: Think of a seesaw motion, where the object tilts up or down along its side axis.
///
/// - **Yaw**: Like turning your head left or right, this is a rotation around the vertical axis
///
/// ### Using an Axis and Angle
///
/// When rotating a part around an axis, you specify the axis of rotation and the angle of
/// rotation.
///
/// ```kcl,legacySketch
/// // Rotate a pipe with roll, pitch, and yaw.
///
/// // Create a path for the sweep.
/// sweepPath = startSketchOn(XZ)
///     |> startProfile(at = [0.05, 0.05])
///     |> line(end = [0, 7])
///     |> tangentialArc(angle = 90deg, radius = 5)
///     |> line(end = [-3, 0])
///     |> tangentialArc(angle = -90deg, radius = 5)
///     |> line(end = [0, 7])
///
/// // Create a hole for the pipe.
/// pipeHole = startSketchOn(XY)
///     |> circle(
///         center = [0, 0],
///         radius = 1.5,
///     )
///
/// sweepSketch = startSketchOn(XY)
///     |> circle(
///         center = [0, 0],
///         radius = 2,
///         )              
///     |> subtract2d(tool = pipeHole)
///     |> sweep(path = sweepPath)   
///     |> rotate(
///         roll = 10,
///         pitch =  10,
///         yaw = 90,
///     )
/// ```
///
/// ```kcl,legacySketch
/// // Rotate a pipe with just roll.
///
/// // Create a path for the sweep.
/// sweepPath = startSketchOn(XZ)
///     |> startProfile(at = [0.05, 0.05])
///     |> line(end = [0, 7])
///     |> tangentialArc(angle = 90deg, radius = 5)
///     |> line(end = [-3, 0])
///     |> tangentialArc(angle = -90deg, radius = 5)
///     |> line(end = [0, 7])
///
/// // Create a hole for the pipe.
/// pipeHole = startSketchOn(XY)
///     |> circle(
///         center = [0, 0],
///         radius = 1.5,
///     )
///
/// sweepSketch = startSketchOn(XY)
///     |> circle(
///         center = [0, 0],
///         radius = 2,
///         )              
///     |> subtract2d(tool = pipeHole)
///     |> sweep(path = sweepPath)   
///     |> rotate(
///         roll = 10,
///     )
/// ```
///
/// ```kcl,legacySketch
/// // Rotate a pipe about a named axis with an angle.
///
/// // Create a path for the sweep.
/// sweepPath = startSketchOn(XZ)
///     |> startProfile(at = [0.05, 0.05])
///     |> line(end = [0, 7])
///     |> tangentialArc(angle = 90deg, radius = 5)
///     |> line(end = [-3, 0])
///     |> tangentialArc(angle = -90deg, radius = 5)
///     |> line(end = [0, 7])
///
/// // Create a hole for the pipe.
/// pipeHole = startSketchOn(XY)
///     |> circle(
///         center = [0, 0],
///         radius = 1.5,
///    )
///
/// sweepSketch = startSketchOn(XY)
///     |> circle(
///         center = [0, 0],
///         radius = 2,
///         )              
///     |> subtract2d(tool = pipeHole)
///     |> sweep(path = sweepPath)   
///     |> rotate(
///     axis =  Z,
///     angle = 90deg,
///     )
/// ```
///
/// ```kcl,sketchSyntaxAgnostic
/// // Rotate an imported model.
///
/// import "tests/inputs/cube.sldprt" as cube
///
/// cube
///     |> rotate(
///     axis =  [0, 0, 1.0],
///     angle = 9deg,
///     )
/// ```
///
/// ```kcl,legacySketch
/// // Rotate a pipe about a raw axis with an angle.
///
/// // Create a path for the sweep.
/// sweepPath = startSketchOn(XZ)
///     |> startProfile(at = [0.05, 0.05])
///     |> line(end = [0, 7])
///     |> tangentialArc(angle = 90deg, radius = 5)
///     |> line(end = [-3, 0])
///     |> tangentialArc(angle = -90deg, radius = 5)
///     |> line(end = [0, 7])
///
/// // Create a hole for the pipe.
/// pipeHole = startSketchOn(XY)
///     |> circle(
///         center = [0, 0],
///         radius = 1.5,
///    )
///
/// sweepSketch = startSketchOn(XY)
///     |> circle(
///         center = [0, 0],
///         radius = 2,
///         )              
///     |> subtract2d(tool = pipeHole)
///     |> sweep(path = sweepPath)   
///     |> rotate(
///     axis =  [0, 0, 1.0],
///     angle = 90deg,
///     )
/// ```
///
/// ```kcl,legacySketch
/// // Sweep two sketches along the same path.
///
/// sketch001 = startSketchOn(XY)
/// rectangleSketch = startProfile(sketch001, at = [-200, 23.86])
///     |> angledLine(angle = 0, length = 73.47, tag = $rectangleSegmentA001)
///     |> angledLine(
///         angle = segAng(rectangleSegmentA001) - 90,
///         length = 50.61,
///     )
///     |> angledLine(
///         angle = segAng(rectangleSegmentA001),
///         length = -segLen(rectangleSegmentA001),
///     )
///     |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
///     |> close()
///
/// circleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)
///
/// sketch002 = startSketchOn(YZ)
/// sweepPath = startProfile(sketch002, at = [0, 0])
///     |> yLine(length = 231.81)
///     |> tangentialArc(radius = 80, angle = -90deg)
///     |> xLine(length = 384.93)
///
/// parts = sweep([rectangleSketch, circleSketch], path = sweepPath)
///
/// // Rotate the sweeps.
/// rotate(parts, axis =  [0, 0, 1.0], angle = 90deg)
/// ```
///
/// ```kcl,legacySketch
/// // Translate and rotate a sketch to create a loft.
/// sketch001 = startSketchOn(XY)
///
/// fn square() {
///     return  startProfile(sketch001, at = [-10, 10])
///         |> xLine(length = 20)
///         |> yLine(length = -20)
///         |> xLine(length = -20)
///         |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
///         |> close()
/// }
///
/// profile001 = square()
///
/// profile002 = square()
///     |> translate(x = 0, y = 0, z = 20)
///     |> rotate(axis = [0, 0, 1.0], angle = 45deg)
///
/// loft([profile001, profile002])
/// ```
@(impl = std_rust, feature_tree = true)
export fn rotate(
  /// The solid, sketch, or set of solids or sketches to rotate.
  @objects: [Solid; 1+] | [Sketch; 1+] | ImportedGeometry,
  /// The roll angle. Must be between -360deg and 360deg.
  @(includeInSnippet = true)
  roll?: number(Angle),
  /// The pitch angle. Must be between -360deg and 360deg.
  @(includeInSnippet = true)
  pitch?: number(Angle),
  /// The yaw angle. Must be between -360deg and 360deg.
  @(includeInSnippet = true)
  yaw?: number(Angle),
  /// The axis to rotate around. Must be used with `angle`.
  axis?: Axis3d | Point3d,
  /// The angle to rotate. Must be used with `axis`. Must be between -360deg and 360deg.
  angle?: number(Angle),
  /// If true, the transform is applied in global space. The origin of the model will move. By default, the transform is applied in local sketch axis, therefore the origin will not move.
  global?: bool = false,  
): [Solid; 1+] | [Sketch; 1+] | ImportedGeometry {}

/// Scale a solid or a sketch.
///
/// This is really useful for resizing parts. You can create a part and then scale it to the
/// correct size.
///
/// For sketches, you can use this to scale a sketch and then loft it with another sketch.
///
/// By default the transform is applied in local sketch axis, therefore the origin will not move.
///
/// If you want to apply the transform in global space, set `global` to `true`. The origin of the
/// model will move. If the model is not centered on origin and you scale globally it will
/// look like the model moves and gets bigger at the same time. Say you have a square
/// `(1,1) - (1,2) - (2,2) - (2,1)` and you scale by 2 globally it will become
/// `(2,2) - (2,4)`...etc so the origin has moved from `(1.5, 1.5)` to `(2,2)`.
///
/// ```kcl,legacySketch
/// // Scale a pipe.
///
/// // Create a path for the sweep.
/// sweepPath = startSketchOn(XZ)
///     |> startProfile(at = [0.05, 0.05])
///     |> line(end = [0, 7])
///     |> tangentialArc(angle = 90deg, radius = 5)
///     |> line(end = [-3, 0])
///     |> tangentialArc(angle = -90deg, radius = 5)
///     |> line(end = [0, 7])
///
/// // Create a hole for the pipe.
/// pipeHole = startSketchOn(XY)
///     |> circle(
///         center = [0, 0],
///         radius = 1.5,
///     )
///
/// sweepSketch = startSketchOn(XY)
///     |> circle(
///         center = [0, 0],
///         radius = 2,
///         )              
///     |> subtract2d(tool = pipeHole)
///     |> sweep(path = sweepPath)   
///     |> scale(
///     z = 2.5,
///     )
/// ```
///
/// ```kcl,sketchSyntaxAgnostic
/// // Scale an imported model.
///
/// import "tests/inputs/cube.sldprt" as cube
///
/// cube
///     |> scale(
///     y = 2.5,
///     )
/// ```
///
/// ```kcl,legacySketch
/// // Sweep two sketches along the same path.
///
/// sketch001 = startSketchOn(XY)
/// rectangleSketch = startProfile(sketch001, at = [-200, 23.86])
///     |> angledLine(angle = 0, length = 73.47, tag = $rectangleSegmentA001)
///     |> angledLine(
///         angle = segAng(rectangleSegmentA001) - 90deg,
///         length = 50.61,
///     )
///     |> angledLine(
///         angle = segAng(rectangleSegmentA001),
///         length = -segLen(rectangleSegmentA001),
///     )
///     |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
///     |> close()
///
/// circleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)
///
/// sketch002 = startSketchOn(YZ)
/// sweepPath = startProfile(sketch002, at = [0, 0])
///     |> yLine(length = 231.81)
///     |> tangentialArc(radius = 80, angle = -90deg)
///     |> xLine(length = 384.93)
///
/// parts = sweep([rectangleSketch, circleSketch], path = sweepPath)
///
/// // Scale the sweep.
/// scale(parts, z = 0.5)
/// ```
/// ```kcl,legacySketch
/// // Make one button (i.e. just a cylinder)
/// button1 = startSketchOn(XY)
///   |> circle(center = [0, 0], radius = 1.53)
///   |> extrude(length = 1)
/// 
/// // Duplicate it, but use `scale` to make it smaller.
/// button2 = startSketchOn(XY)
///   |> circle(center = [0, 0], radius = 1.53)
///   |> extrude(length = 1)
///   |> translate(x = 4)
///   // Make it 50% smaller and gold
///   |> scale(factor = 0.5)
///   |> appearance(color = "#ff9922")
/// ```
@(impl = std_rust, feature_tree = true)
export fn scale(
  /// The solid, sketch, or set of solids or sketches to scale.
  @objects: [Solid; 1+] | [Sketch; 1+] | ImportedGeometry,
  /// The scale factor for the x axis.
  @(includeInSnippet = true)
  x?: number(Count) = 1,
  /// The scale factor for the y axis.
  @(includeInSnippet = true)
  y?: number(Count) = 1,
  /// The scale factor for the z axis.
  @(includeInSnippet = true)
  z?: number(Count) = 1,
  /// If true, the transform is applied in global space. The origin of the model will move. By default, the transform is applied in local sketch axis, therefore the origin will not move.
  global?: bool = false,  
  /// If given, scale the solid by this much.
  /// Equivalent to setting `x`, `y` and `z` all to this number.
  /// Incompatible with `x`, `y` or `z`.
  factor?: number(Count),
): [Solid; 1+] | [Sketch; 1+] | ImportedGeometry {}

/// Hide solids, sketches, helices, or imported objects.
///
/// Hidden objects remain in the model and can still be referenced by later operations.
/// Hiding can be useful to see hard-to-reach vantages, or clarify overlapping geometry
/// while you work.
///
/// ```kcl,legacySketch
/// // Hide a body, leaving a sketch on face intact
/// cylinder = startSketchOn(XY)
///   |> circle(center = [0, 0], radius = 2)
///   |> extrude(length = 2mm)
/// dot = startSketchOn(cylinder, face = END)
///   |> circle(center = [0, 0], radius = 1)
/// hide(cylinder)
/// ```
/// ```kcl,legacySketch
/// // Hide an imported model, leaving a local sketch.
/// import "tests/inputs/cube.sldprt" as cube
///
/// dot = startSketchOn(XY)
///   |> circle(center = [0, 0], radius = 1)
/// cube
///     |> hide()
/// ```
/// ```kcl,legacySketch
/// // Hide a helix, leave its cylinder
/// cylinder = startSketchOn(XY)
///   |> circle(center = [0, 0], radius = 2)
///   |> extrude(length = 2mm)
/// helix001 = helix(revolutions = 16, angleStart = 0, cylinder)
/// hide(helix001)
/// ```
@(impl = std_rust, feature_tree = true)
export fn hide(
  /// The solid, sketch, or set of solids or sketches to hide.
  @objects: [Solid; 1+] | [Sketch; 1+] | [Helix; 1+] | ImportedGeometry,
): [Solid; 1+] | [Sketch; 1+] | [Helix; 1+] | ImportedGeometry {}