* Add parsing keyword function calls inside pipelines Co-authored-by: Adam Chalmers <adam.chalmers@zoo.dev> * Add three point circle stdlib function * Generate new documentation * Fix 20:20 for the circle three point test * Convert to using keyword arguments * Wtf yo * Remove unused structure * Use the new simulation tests * Regenerate documentation --------- Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Adam Chalmers <adam.chalmers@zoo.dev>
		
			
				
	
	
		
			102 lines
		
	
	
		
			292 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			102 lines
		
	
	
		
			292 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
---
 | 
						|
title: "mirror2d"
 | 
						|
excerpt: "Mirror a sketch."
 | 
						|
layout: manual
 | 
						|
---
 | 
						|
 | 
						|
Mirror a sketch.
 | 
						|
 | 
						|
Only works on unclosed sketches for now.
 | 
						|
 | 
						|
Mirror occurs around a local sketch axis rather than a global axis.
 | 
						|
 | 
						|
```js
 | 
						|
mirror2d(data: Mirror2dData, sketch_set: SketchSet) -> [Sketch]
 | 
						|
```
 | 
						|
 | 
						|
 | 
						|
### Arguments
 | 
						|
 | 
						|
| Name | Type | Description | Required |
 | 
						|
|----------|------|-------------|----------|
 | 
						|
| `data` | [`Mirror2dData`](/docs/kcl/types/Mirror2dData) | Data for a mirror. | Yes |
 | 
						|
| `sketch_set` | [`SketchSet`](/docs/kcl/types/SketchSet) | A sketch or a group of sketches. | Yes |
 | 
						|
 | 
						|
### Returns
 | 
						|
 | 
						|
[`[Sketch]`](/docs/kcl/types/Sketch) 
 | 
						|
 | 
						|
 | 
						|
### Examples
 | 
						|
 | 
						|
```js
 | 
						|
// Mirror an un-closed sketch across the Y axis.
 | 
						|
sketch001 = startSketchOn('XZ')
 | 
						|
  |> startProfileAt([0, 10], %)
 | 
						|
  |> line([15, 0], %)
 | 
						|
  |> line([-7, -3], %)
 | 
						|
  |> line([9, -1], %)
 | 
						|
  |> line([-8, -5], %)
 | 
						|
  |> line([9, -3], %)
 | 
						|
  |> line([-8, -3], %)
 | 
						|
  |> line([9, -1], %)
 | 
						|
  |> line([-19, -0], %)
 | 
						|
  |> mirror2d({ axis = 'Y' }, %)
 | 
						|
 | 
						|
example = extrude(10, sketch001)
 | 
						|
```
 | 
						|
 | 
						|

 | 
						|
 | 
						|
```js
 | 
						|
// Mirror a un-closed sketch across the Y axis.
 | 
						|
sketch001 = startSketchOn('XZ')
 | 
						|
  |> startProfileAt([0, 8.5], %)
 | 
						|
  |> line([20, -8.5], %)
 | 
						|
  |> line([-20, -8.5], %)
 | 
						|
  |> mirror2d({ axis = 'Y' }, %)
 | 
						|
 | 
						|
example = extrude(10, sketch001)
 | 
						|
```
 | 
						|
 | 
						|

 | 
						|
 | 
						|
```js
 | 
						|
// Mirror a un-closed sketch across an edge.
 | 
						|
helper001 = startSketchOn('XZ')
 | 
						|
  |> startProfileAt([0, 0], %)
 | 
						|
  |> line([0, 10], %, $edge001)
 | 
						|
 | 
						|
sketch001 = startSketchOn('XZ')
 | 
						|
  |> startProfileAt([0, 8.5], %)
 | 
						|
  |> line([20, -8.5], %)
 | 
						|
  |> line([-20, -8.5], %)
 | 
						|
  |> mirror2d({ axis = edge001 }, %)
 | 
						|
 | 
						|
example = extrude(10, sketch001)
 | 
						|
```
 | 
						|
 | 
						|

 | 
						|
 | 
						|
```js
 | 
						|
// Mirror an un-closed sketch across a custom axis.
 | 
						|
sketch001 = startSketchOn('XZ')
 | 
						|
  |> startProfileAt([0, 8.5], %)
 | 
						|
  |> line([20, -8.5], %)
 | 
						|
  |> line([-20, -8.5], %)
 | 
						|
  |> mirror2d({
 | 
						|
       axis = {
 | 
						|
         custom = {
 | 
						|
           axis = [0.0, 1.0],
 | 
						|
           origin = [0.0, 0.0]
 | 
						|
         }
 | 
						|
       }
 | 
						|
     }, %)
 | 
						|
 | 
						|
example = extrude(10, sketch001)
 | 
						|
```
 | 
						|
 | 
						|

 | 
						|
 | 
						|
 |