Skip to content

Commit

Permalink
Make expandPath not assume there is an associated sweep artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
franknoirot committed Nov 4, 2024
1 parent 437ef70 commit 544871e
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/lang/std/artifactGraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ interface solid2D {
}
export interface PathArtifactRich {
type: 'path'
/** A path must always lie on a plane */
plane: PlaneArtifact | WallArtifact
/** A path must always contain 0 or more segments */
segments: Array<SegmentArtifact>
sweep: SweepArtifact
/** A path may not result in a sweep artifact */
sweep?: SweepArtifact
codeRef: CommonCommandProperties
}

Expand Down Expand Up @@ -587,13 +590,15 @@ export function expandPath(
{ keys: path.segIds, types: ['segment'] },
artifactGraph
)
const sweep = getArtifactOfTypes(
{
key: path.sweepId,
types: ['sweep'],
},
artifactGraph
)
const sweep = path.sweepId
? getArtifactOfTypes(
{
key: path.sweepId,
types: ['sweep'],
},
artifactGraph
)
: undefined
const plane = getArtifactOfTypes(
{ key: path.planeId, types: ['plane', 'wall'] },
artifactGraph
Expand Down

0 comments on commit 544871e

Please sign in to comment.