Linear patterns (#1362)
* add linear patterns Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix clippy Signed-off-by: Jess Frazelle <github@jessfraz.com> * add failing test for serialisation issue * cleanup tests Signed-off-by: Jess Frazelle <github@jessfraz.com> * cleanup memoryitem Signed-off-by: Jess Frazelle <github@jessfraz.com> * add test to serialize memory item from rust Signed-off-by: Jess Frazelle <github@jessfraz.com> * update test Signed-off-by: Jess Frazelle <github@jessfraz.com> * run cargo sort everywhere Signed-off-by: Jess Frazelle <github@jessfraz.com> * run fmt everywhere Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix typo Signed-off-by: Jess Frazelle <github@jessfraz.com> * clean up linear paterns on re-execute * selections fix for patterns * fix clippy Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch>
This commit is contained in:
		
							
								
								
									
										2964
									
								
								docs/kcl/std.json
									
									
									
									
									
								
							
							
						
						
									
										2964
									
								
								docs/kcl/std.json
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										157
									
								
								docs/kcl/std.md
									
									
									
									
									
								
							
							
						
						
									
										157
									
								
								docs/kcl/std.md
									
									
									
									
									
								
							@ -40,6 +40,7 @@
 | 
			
		||||
	* [`log2`](#log2)
 | 
			
		||||
	* [`max`](#max)
 | 
			
		||||
	* [`min`](#min)
 | 
			
		||||
	* [`patternLinear`](#patternLinear)
 | 
			
		||||
	* [`pi`](#pi)
 | 
			
		||||
	* [`pow`](#pow)
 | 
			
		||||
	* [`segAng`](#segAng)
 | 
			
		||||
@ -2430,12 +2431,12 @@ Use a sketch to cut a hole in another sketch.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
hole(hole_sketch_group: SketchGroup, sketch_group: SketchGroup) -> SketchGroup
 | 
			
		||||
hole(hole_sketch_group: SketchGroupSet, sketch_group: SketchGroup) -> SketchGroup
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
#### Arguments
 | 
			
		||||
 | 
			
		||||
* `hole_sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
 | 
			
		||||
* `hole_sketch_group`: `SketchGroupSet` - A sketch group or a group of sketch groups.
 | 
			
		||||
```
 | 
			
		||||
{
 | 
			
		||||
	// The id of the sketch group.
 | 
			
		||||
@ -2455,6 +2456,7 @@ hole(hole_sketch_group: SketchGroup, sketch_group: SketchGroup) -> SketchGroup
 | 
			
		||||
	// The to point.
 | 
			
		||||
	to: [number, number],
 | 
			
		||||
},
 | 
			
		||||
	type: string,
 | 
			
		||||
	// The paths in the sketch group.
 | 
			
		||||
	value: [{
 | 
			
		||||
	// The from point.
 | 
			
		||||
@ -2517,6 +2519,9 @@ hole(hole_sketch_group: SketchGroup, sketch_group: SketchGroup) -> SketchGroup
 | 
			
		||||
	yAxis: [number, number, number],
 | 
			
		||||
	// The z-axis of the sketch group base plane in the 3D space
 | 
			
		||||
	zAxis: [number, number, number],
 | 
			
		||||
} |
 | 
			
		||||
{
 | 
			
		||||
	type: string,
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths.
 | 
			
		||||
@ -3475,6 +3480,154 @@ min(args: [number]) -> number
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### patternLinear
 | 
			
		||||
 | 
			
		||||
A linear pattern.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
patternLinear(data: LinearPatternData, geometry: Geometry) -> Geometries
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
#### Arguments
 | 
			
		||||
 | 
			
		||||
* `data`: `LinearPatternData` - Data for a linear pattern.
 | 
			
		||||
```
 | 
			
		||||
{
 | 
			
		||||
	// The axis of the pattern. This is a 3D vector.
 | 
			
		||||
	axis: [number, number, number],
 | 
			
		||||
	// The distance between each repetition. This can also be referred to as spacing.
 | 
			
		||||
	distance: number,
 | 
			
		||||
	// The number of repetitions. Must be greater than 0. This excludes the original entity. For example, if `repetitions` is 1, the original entity will be copied once.
 | 
			
		||||
	repetitions: number,
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
* `geometry`: `Geometry` - A geometry.
 | 
			
		||||
```
 | 
			
		||||
{
 | 
			
		||||
	// The id of the sketch group.
 | 
			
		||||
	id: uuid,
 | 
			
		||||
	// The plane id of the sketch group.
 | 
			
		||||
	planeId: uuid,
 | 
			
		||||
	// The position of the sketch group.
 | 
			
		||||
	position: [number, number, number],
 | 
			
		||||
	// The rotation of the sketch group base plane.
 | 
			
		||||
	rotation: [number, number, number, number],
 | 
			
		||||
	// The starting path.
 | 
			
		||||
	start: {
 | 
			
		||||
	// The from point.
 | 
			
		||||
	from: [number, number],
 | 
			
		||||
	// The name of the path.
 | 
			
		||||
	name: string,
 | 
			
		||||
	// The to point.
 | 
			
		||||
	to: [number, number],
 | 
			
		||||
},
 | 
			
		||||
	type: string,
 | 
			
		||||
	// The paths in the sketch group.
 | 
			
		||||
	value: [{
 | 
			
		||||
	// The from point.
 | 
			
		||||
	from: [number, number],
 | 
			
		||||
	// The name of the path.
 | 
			
		||||
	name: string,
 | 
			
		||||
	// The to point.
 | 
			
		||||
	to: [number, number],
 | 
			
		||||
	type: string,
 | 
			
		||||
} |
 | 
			
		||||
{
 | 
			
		||||
	// arc's direction
 | 
			
		||||
	ccw: string,
 | 
			
		||||
	// the arc's center
 | 
			
		||||
	center: [number, number],
 | 
			
		||||
	// The from point.
 | 
			
		||||
	from: [number, number],
 | 
			
		||||
	// The name of the path.
 | 
			
		||||
	name: string,
 | 
			
		||||
	// The to point.
 | 
			
		||||
	to: [number, number],
 | 
			
		||||
	type: string,
 | 
			
		||||
} |
 | 
			
		||||
{
 | 
			
		||||
	// The from point.
 | 
			
		||||
	from: [number, number],
 | 
			
		||||
	// The name of the path.
 | 
			
		||||
	name: string,
 | 
			
		||||
	// The to point.
 | 
			
		||||
	to: [number, number],
 | 
			
		||||
	type: string,
 | 
			
		||||
	// The x coordinate.
 | 
			
		||||
	x: number,
 | 
			
		||||
} |
 | 
			
		||||
{
 | 
			
		||||
	// The from point.
 | 
			
		||||
	from: [number, number],
 | 
			
		||||
	// The name of the path.
 | 
			
		||||
	name: string,
 | 
			
		||||
	// The to point.
 | 
			
		||||
	to: [number, number],
 | 
			
		||||
	type: string,
 | 
			
		||||
	// The x coordinate.
 | 
			
		||||
	x: number,
 | 
			
		||||
	// The y coordinate.
 | 
			
		||||
	y: number,
 | 
			
		||||
} |
 | 
			
		||||
{
 | 
			
		||||
	// The from point.
 | 
			
		||||
	from: [number, number],
 | 
			
		||||
	// The name of the path.
 | 
			
		||||
	name: string,
 | 
			
		||||
	// The to point.
 | 
			
		||||
	to: [number, number],
 | 
			
		||||
	type: string,
 | 
			
		||||
}],
 | 
			
		||||
	// The x-axis of the sketch group base plane in the 3D space
 | 
			
		||||
	xAxis: [number, number, number],
 | 
			
		||||
	// The y-axis of the sketch group base plane in the 3D space
 | 
			
		||||
	yAxis: [number, number, number],
 | 
			
		||||
	// The z-axis of the sketch group base plane in the 3D space
 | 
			
		||||
	zAxis: [number, number, number],
 | 
			
		||||
} |
 | 
			
		||||
{
 | 
			
		||||
	// The height of the extrude group.
 | 
			
		||||
	height: number,
 | 
			
		||||
	// The id of the extrude group.
 | 
			
		||||
	id: uuid,
 | 
			
		||||
	// The position of the extrude group.
 | 
			
		||||
	position: [number, number, number],
 | 
			
		||||
	// The rotation of the extrude group.
 | 
			
		||||
	rotation: [number, number, number, number],
 | 
			
		||||
	type: string,
 | 
			
		||||
	// The extrude surfaces.
 | 
			
		||||
	value: [{
 | 
			
		||||
	// The id of the geometry.
 | 
			
		||||
	id: uuid,
 | 
			
		||||
	// The name.
 | 
			
		||||
	name: string,
 | 
			
		||||
	// The position.
 | 
			
		||||
	position: [number, number, number],
 | 
			
		||||
	// The rotation.
 | 
			
		||||
	rotation: [number, number, number, number],
 | 
			
		||||
	// The source range.
 | 
			
		||||
	sourceRange: [number, number],
 | 
			
		||||
	type: string,
 | 
			
		||||
}],
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
#### Returns
 | 
			
		||||
 | 
			
		||||
* `Geometries` - A set of geometry.
 | 
			
		||||
```
 | 
			
		||||
{
 | 
			
		||||
	type: string,
 | 
			
		||||
} |
 | 
			
		||||
{
 | 
			
		||||
	type: string,
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### pi
 | 
			
		||||
 | 
			
		||||
Return the value of `pi`. Archimedes’ constant (π).
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user