Sketch on chamfer UI (#3918)
* sketch on chamfer start * working * step app from getting in weird state when selection face to sketch on * sketch on chamfer tests * clean up * fix test * fix click selections for chamfers, add tests * fixture setup (#3964) * initial break up * rename main fixture file * add more expect state pattern * add fixture comment * add comments to chamfer function * typos * works without pipeExpr
This commit is contained in:
@ -42,7 +42,7 @@ export interface PathArtifactRich {
|
||||
codeRef: CommonCommandProperties
|
||||
}
|
||||
|
||||
interface SegmentArtifact {
|
||||
export interface SegmentArtifact {
|
||||
type: 'segment'
|
||||
pathId: ArtifactId
|
||||
surfaceId: ArtifactId
|
||||
@ -436,10 +436,10 @@ export function getArtifactsToUpdate({
|
||||
response.data.modeling_response.type === 'solid3d_get_opposite_edge' &&
|
||||
response.data.modeling_response.data.edge) ||
|
||||
// or is adjacent edge
|
||||
(cmd.type === 'solid3d_get_prev_adjacent_edge' &&
|
||||
(cmd.type === 'solid3d_get_next_adjacent_edge' &&
|
||||
response.type === 'modeling' &&
|
||||
response.data.modeling_response.type ===
|
||||
'solid3d_get_prev_adjacent_edge' &&
|
||||
'solid3d_get_next_adjacent_edge' &&
|
||||
response.data.modeling_response.data.edge)
|
||||
) {
|
||||
const wall = getArtifact(cmd.face_id)
|
||||
@ -457,7 +457,7 @@ export function getArtifactsToUpdate({
|
||||
artifact: {
|
||||
type: 'sweepEdge',
|
||||
subType:
|
||||
cmd.type === 'solid3d_get_prev_adjacent_edge'
|
||||
cmd.type === 'solid3d_get_next_adjacent_edge'
|
||||
? 'adjacent'
|
||||
: 'opposite',
|
||||
segId: cmd.edge_id,
|
||||
@ -724,18 +724,52 @@ export function getSweepEdgeCodeRef(
|
||||
if (err(seg)) return seg
|
||||
return seg.codeRef
|
||||
}
|
||||
export function getEdgeCuteConsumedCodeRef(
|
||||
edge: EdgeCut,
|
||||
artifactGraph: ArtifactGraph
|
||||
): CommonCommandProperties | Error {
|
||||
const seg = getArtifactOfTypes(
|
||||
{ key: edge.consumedEdgeId, types: ['segment', 'sweepEdge'] },
|
||||
artifactGraph
|
||||
)
|
||||
if (err(seg)) return seg
|
||||
if (seg.type === 'segment') return seg.codeRef
|
||||
return getSweepEdgeCodeRef(seg, artifactGraph)
|
||||
}
|
||||
|
||||
export function getSweepFromSuspectedSweepSurface(
|
||||
id: ArtifactId,
|
||||
artifactGraph: ArtifactGraph
|
||||
): SweepArtifact | Error {
|
||||
const artifact = getArtifactOfTypes(
|
||||
{ key: id, types: ['wall', 'cap'] },
|
||||
{ key: id, types: ['wall', 'cap', 'edgeCut'] },
|
||||
artifactGraph
|
||||
)
|
||||
if (err(artifact)) return artifact
|
||||
if (artifact.type === 'wall' || artifact.type === 'cap') {
|
||||
return getArtifactOfTypes(
|
||||
{ key: artifact.sweepId, types: ['sweep'] },
|
||||
artifactGraph
|
||||
)
|
||||
}
|
||||
const segOrEdge = getArtifactOfTypes(
|
||||
{ key: artifact.consumedEdgeId, types: ['segment', 'sweepEdge'] },
|
||||
artifactGraph
|
||||
)
|
||||
if (err(segOrEdge)) return segOrEdge
|
||||
if (segOrEdge.type === 'segment') {
|
||||
const path = getArtifactOfTypes(
|
||||
{ key: segOrEdge.pathId, types: ['path'] },
|
||||
artifactGraph
|
||||
)
|
||||
if (err(path)) return path
|
||||
return getArtifactOfTypes(
|
||||
{ key: path.sweepId, types: ['sweep'] },
|
||||
artifactGraph
|
||||
)
|
||||
}
|
||||
return getArtifactOfTypes(
|
||||
{ key: artifact.sweepId, types: ['sweep'] },
|
||||
{ key: segOrEdge.sweepId, types: ['sweep'] },
|
||||
artifactGraph
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user