* updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fmt Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * unit tests pass Signed-off-by: Jess Frazelle <github@jessfraz.com> * playwright Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * format Signed-off-by: Jess Frazelle <github@jessfraz.com> * format Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * more literals gone Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * remove console log Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * remove only Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix some recast shit Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * last Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
734 lines
179 KiB
Markdown
734 lines
179 KiB
Markdown
---
|
||
title: "angledLineOfXLength"
|
||
excerpt: "Draw an angled line of a given x length."
|
||
layout: manual
|
||
---
|
||
|
||
Draw an angled line of a given x length.
|
||
|
||
|
||
|
||
```js
|
||
angledLineOfXLength(data: AngledLineData, sketch_group: SketchGroup, tag?: TagDeclarator) -> SketchGroup
|
||
```
|
||
|
||
### Examples
|
||
|
||
```js
|
||
const sketch001 = startSketchOn('XZ')
|
||
|> startProfileAt([0, 0], %)
|
||
|> angledLineOfXLength({ angle: 45, length: 10 }, %, $edge1)
|
||
|> angledLineOfXLength({ angle: -15, length: 20 }, %, $edge2)
|
||
|> line([0, -5], %)
|
||
|> close(%, $edge3)
|
||
|
||
const extrusion = extrude(10, sketch001)
|
||
```
|
||
|
||

|
||
|
||
### Arguments
|
||
|
||
* `data`: `AngledLineData` - Data to draw an angled line. (REQUIRED)
|
||
```js
|
||
{
|
||
// The angle of the line.
|
||
angle: number,
|
||
// The length of the line.
|
||
length: number,
|
||
} |
|
||
[number, number]
|
||
```
|
||
* `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. (REQUIRED)
|
||
```js
|
||
{
|
||
// The id of the sketch group.
|
||
id: uuid,
|
||
// What the sketch is on (can be a plane or a face).
|
||
on: {
|
||
// The id of the plane.
|
||
id: uuid,
|
||
// Origin of the plane.
|
||
origin: {
|
||
x: number,
|
||
y: number,
|
||
z: number,
|
||
},
|
||
type: "plane",
|
||
// Type for a plane.
|
||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||
// What should the plane’s X axis be?
|
||
xAxis: {
|
||
x: number,
|
||
y: number,
|
||
z: number,
|
||
},
|
||
// What should the plane’s Y axis be?
|
||
yAxis: {
|
||
x: number,
|
||
y: number,
|
||
z: number,
|
||
},
|
||
// The z-axis (normal).
|
||
zAxis: {
|
||
x: number,
|
||
y: number,
|
||
z: number,
|
||
},
|
||
} |
|
||
{
|
||
// The extrude group the face is on.
|
||
extrudeGroup: {
|
||
// The id of the extrusion end cap
|
||
endCapId: uuid,
|
||
// Chamfers or fillets on this extrude group.
|
||
filletOrChamfers: [{
|
||
// The engine id of the edge to fillet.
|
||
edge_id: uuid,
|
||
// The id of the engine command that called this fillet.
|
||
id: uuid,
|
||
radius: number,
|
||
type: "fillet",
|
||
} |
|
||
{
|
||
// The engine id of the edge to chamfer.
|
||
edge_id: uuid,
|
||
// The id of the engine command that called this chamfer.
|
||
id: uuid,
|
||
length: number,
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
type: "chamfer",
|
||
}],
|
||
// The height of the extrude group.
|
||
height: number,
|
||
// The id of the extrude group.
|
||
id: uuid,
|
||
// The sketch group.
|
||
sketchGroup: {
|
||
// The id of the sketch group.
|
||
id: uuid,
|
||
// What the sketch is on (can be a plane or a face).
|
||
on: SketchSurface,
|
||
// The starting path.
|
||
start: {
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
},
|
||
// The paths in the sketch group.
|
||
value: [{
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
type: "ToPoint",
|
||
} |
|
||
{
|
||
// arc's direction
|
||
ccw: string,
|
||
// the arc's center
|
||
center: [number, number],
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
type: "TangentialArcTo",
|
||
} |
|
||
{
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
type: "TangentialArc",
|
||
} |
|
||
{
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
type: "Horizontal",
|
||
// The x coordinate.
|
||
x: number,
|
||
} |
|
||
{
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
type: "AngledLineTo",
|
||
// The x coordinate.
|
||
x: number,
|
||
// The y coordinate.
|
||
y: number,
|
||
} |
|
||
{
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
type: "Base",
|
||
}],
|
||
},
|
||
// The id of the extrusion start cap
|
||
startCapId: uuid,
|
||
// The extrude surfaces.
|
||
value: [{
|
||
// The face id for the extrude plane.
|
||
faceId: uuid,
|
||
// The id of the geometry.
|
||
id: uuid,
|
||
// The source range.
|
||
sourceRange: [number, number],
|
||
// The tag.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
type: "extrudePlane",
|
||
} |
|
||
{
|
||
// The face id for the extrude plane.
|
||
faceId: uuid,
|
||
// The id of the geometry.
|
||
id: uuid,
|
||
// The source range.
|
||
sourceRange: [number, number],
|
||
// The tag.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
type: "extrudeArc",
|
||
}],
|
||
},
|
||
// The id of the face.
|
||
id: uuid,
|
||
type: "face",
|
||
// The tag of the face.
|
||
value: string,
|
||
// What should the face’s X axis be?
|
||
xAxis: {
|
||
x: number,
|
||
y: number,
|
||
z: number,
|
||
},
|
||
// What should the face’s Y axis be?
|
||
yAxis: {
|
||
x: number,
|
||
y: number,
|
||
z: number,
|
||
},
|
||
// The z-axis (normal).
|
||
zAxis: {
|
||
x: number,
|
||
y: number,
|
||
z: number,
|
||
},
|
||
},
|
||
// The starting path.
|
||
start: {
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
},
|
||
// The paths in the sketch group.
|
||
value: [{
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
type: "ToPoint",
|
||
} |
|
||
{
|
||
// arc's direction
|
||
ccw: string,
|
||
// the arc's center
|
||
center: [number, number],
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
type: "TangentialArcTo",
|
||
} |
|
||
{
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
type: "TangentialArc",
|
||
} |
|
||
{
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
type: "Horizontal",
|
||
// The x coordinate.
|
||
x: number,
|
||
} |
|
||
{
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
type: "AngledLineTo",
|
||
// The x coordinate.
|
||
x: number,
|
||
// The y coordinate.
|
||
y: number,
|
||
} |
|
||
{
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
type: "Base",
|
||
}],
|
||
}
|
||
```
|
||
* `tag`: `TagDeclarator` (OPTIONAL)
|
||
```js
|
||
{
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
}
|
||
```
|
||
|
||
### Returns
|
||
|
||
`SketchGroup` - A sketch group is a collection of paths.
|
||
```js
|
||
{
|
||
// The id of the sketch group.
|
||
id: uuid,
|
||
// What the sketch is on (can be a plane or a face).
|
||
on: {
|
||
// The id of the plane.
|
||
id: uuid,
|
||
// Origin of the plane.
|
||
origin: {
|
||
x: number,
|
||
y: number,
|
||
z: number,
|
||
},
|
||
type: "plane",
|
||
// Type for a plane.
|
||
value: "XY" | "XZ" | "YZ" | "Custom",
|
||
// What should the plane’s X axis be?
|
||
xAxis: {
|
||
x: number,
|
||
y: number,
|
||
z: number,
|
||
},
|
||
// What should the plane’s Y axis be?
|
||
yAxis: {
|
||
x: number,
|
||
y: number,
|
||
z: number,
|
||
},
|
||
// The z-axis (normal).
|
||
zAxis: {
|
||
x: number,
|
||
y: number,
|
||
z: number,
|
||
},
|
||
} |
|
||
{
|
||
// The extrude group the face is on.
|
||
extrudeGroup: {
|
||
// The id of the extrusion end cap
|
||
endCapId: uuid,
|
||
// Chamfers or fillets on this extrude group.
|
||
filletOrChamfers: [{
|
||
// The engine id of the edge to fillet.
|
||
edge_id: uuid,
|
||
// The id of the engine command that called this fillet.
|
||
id: uuid,
|
||
radius: number,
|
||
type: "fillet",
|
||
} |
|
||
{
|
||
// The engine id of the edge to chamfer.
|
||
edge_id: uuid,
|
||
// The id of the engine command that called this chamfer.
|
||
id: uuid,
|
||
length: number,
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
type: "chamfer",
|
||
}],
|
||
// The height of the extrude group.
|
||
height: number,
|
||
// The id of the extrude group.
|
||
id: uuid,
|
||
// The sketch group.
|
||
sketchGroup: {
|
||
// The id of the sketch group.
|
||
id: uuid,
|
||
// What the sketch is on (can be a plane or a face).
|
||
on: SketchSurface,
|
||
// The starting path.
|
||
start: {
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
},
|
||
// The paths in the sketch group.
|
||
value: [{
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
type: "ToPoint",
|
||
} |
|
||
{
|
||
// arc's direction
|
||
ccw: string,
|
||
// the arc's center
|
||
center: [number, number],
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
type: "TangentialArcTo",
|
||
} |
|
||
{
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
type: "TangentialArc",
|
||
} |
|
||
{
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
type: "Horizontal",
|
||
// The x coordinate.
|
||
x: number,
|
||
} |
|
||
{
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
type: "AngledLineTo",
|
||
// The x coordinate.
|
||
x: number,
|
||
// The y coordinate.
|
||
y: number,
|
||
} |
|
||
{
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
type: "Base",
|
||
}],
|
||
},
|
||
// The id of the extrusion start cap
|
||
startCapId: uuid,
|
||
// The extrude surfaces.
|
||
value: [{
|
||
// The face id for the extrude plane.
|
||
faceId: uuid,
|
||
// The id of the geometry.
|
||
id: uuid,
|
||
// The source range.
|
||
sourceRange: [number, number],
|
||
// The tag.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
type: "extrudePlane",
|
||
} |
|
||
{
|
||
// The face id for the extrude plane.
|
||
faceId: uuid,
|
||
// The id of the geometry.
|
||
id: uuid,
|
||
// The source range.
|
||
sourceRange: [number, number],
|
||
// The tag.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
type: "extrudeArc",
|
||
}],
|
||
},
|
||
// The id of the face.
|
||
id: uuid,
|
||
type: "face",
|
||
// The tag of the face.
|
||
value: string,
|
||
// What should the face’s X axis be?
|
||
xAxis: {
|
||
x: number,
|
||
y: number,
|
||
z: number,
|
||
},
|
||
// What should the face’s Y axis be?
|
||
yAxis: {
|
||
x: number,
|
||
y: number,
|
||
z: number,
|
||
},
|
||
// The z-axis (normal).
|
||
zAxis: {
|
||
x: number,
|
||
y: number,
|
||
z: number,
|
||
},
|
||
},
|
||
// The starting path.
|
||
start: {
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
},
|
||
// The paths in the sketch group.
|
||
value: [{
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
type: "ToPoint",
|
||
} |
|
||
{
|
||
// arc's direction
|
||
ccw: string,
|
||
// the arc's center
|
||
center: [number, number],
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
type: "TangentialArcTo",
|
||
} |
|
||
{
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
type: "TangentialArc",
|
||
} |
|
||
{
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
type: "Horizontal",
|
||
// The x coordinate.
|
||
x: number,
|
||
} |
|
||
{
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
type: "AngledLineTo",
|
||
// The x coordinate.
|
||
x: number,
|
||
// The y coordinate.
|
||
y: number,
|
||
} |
|
||
{
|
||
// The from point.
|
||
from: [number, number],
|
||
// The tag of the path.
|
||
tag: {
|
||
end: number,
|
||
start: number,
|
||
value: string,
|
||
},
|
||
// The to point.
|
||
to: [number, number],
|
||
type: "Base",
|
||
}],
|
||
}
|
||
```
|
||
|
||
|
||
|