Add 3-point circle tool (#4832)

* Add 3-point circle tool

This adds a 1st pass for the 3-point circle tool.

There is disabled code to drag around the 3 points and redraw the circle and
a triangle created by those points. It will be enabled in a follow-up PR
when we have circle3Point in the stdlib.

For now, all it does is after the 3rd click, will insert circle center-radius
KCL code for users to modify.

* PR comments
This commit is contained in:
49fl
2024-12-20 14:30:37 -05:00
committed by GitHub
parent e0c07eecfe
commit 1d06cc7845
4 changed files with 291 additions and 4 deletions

View File

@ -432,10 +432,19 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
},
{
id: 'circle-three-points',
onClick: () =>
console.error('Three-point circle not yet implemented'),
onClick: ({ modelingState, modelingSend }) =>
modelingSend({
type: 'change tool',
data: {
tool: !modelingState.matches({
Sketch: 'circle3PointToolSelect',
})
? 'circle3Points'
: 'none',
},
}),
icon: 'circle',
status: 'unavailable',
status: 'available',
title: 'Three-point circle',
showTitle: false,
description: 'Draw a circle defined by three points',