Give startSketchAt a 3D artifact (#65)

* Give startSketchAt a 3D artifact

* fix tests

* refactor start geo to be in the start property

* small tweak
This commit is contained in:
Kurt Hutten
2023-03-17 08:27:40 +11:00
committed by GitHub
parent d73003e3fd
commit c11e7e7fd3
9 changed files with 113 additions and 29 deletions

View File

@ -240,6 +240,14 @@ function RenderViewerArtifact({
if (artifact.type === 'sketchGroup') {
return (
<>
{artifact.start && (
<PathRender
geoInfo={artifact.start}
forceHighlight={false}
rotation={artifact.rotation}
position={artifact.position}
/>
)}
{artifact.value.map((geoInfo, key) => (
<PathRender
geoInfo={geoInfo}
@ -356,7 +364,7 @@ function PathRender({
return (
<>
{geoInfo.__geoMeta.geos.map((meta, i) => {
if (meta.type === 'line') {
if (meta.type === 'line')
return (
<LineRender
key={i}
@ -367,8 +375,7 @@ function PathRender({
position={position}
/>
)
}
if (meta.type === 'lineEnd') {
if (meta.type === 'lineEnd')
return (
<MovingSphere
key={i}
@ -380,7 +387,17 @@ function PathRender({
position={position}
/>
)
}
if (meta.type === 'sketchBase')
return (
<LineRender
key={i}
geo={meta.geo}
sourceRange={geoInfo.__geoMeta.sourceRange}
forceHighlight={forceHighlight || editorCursor}
rotation={rotation}
position={position}
/>
)
})}
</>
)

View File

@ -60,7 +60,10 @@ export const SetHorzDistance = ({
const isAllTooltips = nodes.every(
(node) =>
node?.type === 'CallExpression' &&
toolTips.includes(node.callee.name as any)
[
...toolTips,
'startSketchAt', // TODO probably a better place for this to live
].includes(node.callee.name as any)
)
const theTransforms = getTransformInfos(