Commit Graph

1979 Commits

Author SHA1 Message Date
52b2e26ac5 alignVertically/Horizontally (#106) 2023-04-06 12:45:56 +10:00
db5220467b set angle between two selected lines (#104) 2023-04-05 21:06:20 +10:00
1a6bcba6ca Select axis for horz/vert distances (#102) 2023-04-05 15:08:46 +10:00
a1848f2563 ui naming tweaks (#100)
ui nameing tweaks
2023-04-03 21:01:26 +10:00
8df08be687 Grid axis should be able to be selected for angles (#99) 2023-04-03 20:40:58 +10:00
a8b68bab6a Users should be able to select points (not just lines) (#97)
* update selection datastructure to accomodate more selection metadata

* Users should be able to select points (not just lines)
2023-04-03 16:05:25 +10:00
7013eb861d colour head of lines (the sphere) with the same constraint colours (#95)
* colour head of lines (the sphere) with the same constraint colours

* tweak arrow size
2023-04-02 18:38:07 +10:00
01bf3c1049 Lengths and angles should be set with |abs| values (#93)
* Lengths and angles should be set with |abs| values

* clean up
2023-04-02 17:20:11 +10:00
b279daa8e0 Fix equal length sign bug for yLines (#91)
If you have a yLine(-5,  %) i.e. it's values is negative -5 than when constraining it to the length of another line, it should take the sign into account and transform it to yLine(-segLen('someSeg', %), %), currently it always does it positively i.e. yLine(segLen('someSeg', %), %) which is jaring for users to see the line they are constraining to flip direction.
2023-04-02 09:34:56 +10:00
252ace6d69 Add common angles are permanent variables, 0, 90,180 etc (#89) 2023-04-01 21:25:00 +11:00
61533fb306 Add UI for closing the sketch loop (#87) 2023-04-01 20:38:31 +11:00
0593afc4ff Replace values with variable helper (#84)
* Refactor getNodePathFromSourceRange

getNodePathFromSourceRange wouldn't go as deep as it should have,
stopping at pipe expressions, when it should have followed as deep
into the ast as possible.

The fact that it stopped early then had other part of the code base that
expected this behaviour and it effected a lot, so a rather large refactor

* overhaul of getNodePathFromSourceRange

* quick fix for moreNodePathFromSourceRange

* minor bugs in moreNodePathFromSourceRange

* couple more tests

* add moveValueIntoNewVariable

* add UI for replacing valuse with variable

* update button text
2023-04-01 16:47:00 +11:00
42eb3506bb quick remove constraining value fix (#82) 2023-03-23 20:39:55 +11:00
ab1639b8b4 Add 'remove constraining values' UI (#80) 2023-03-22 03:02:37 +11:00
45091d3c4f quick bugfix (#78) 2023-03-21 19:02:18 +11:00
5f7ee2c512 Fix indentation for wrapped array and object expressions, within pipe bodies (#77) 2023-03-20 08:13:21 +11:00
37ebfd072c getSketchSegmentIndexFromSourceRange bug fix (#75)
* getSketchSegmentIndexFromSourceRange bug fix

* test was verbose

* rename function
2023-03-20 07:09:19 +11:00
1ac3713a79 Add constraint colour indications (#73) 2023-03-19 21:25:22 +11:00
22c356a841 Add intersect constraint UI (#71)
* Add intersect constraint UI

* add more combos for intersect constraint
2023-03-19 18:46:39 +11:00
0995780abb add Equal angle constraint + more cases for existing constraints (#69)
* add more setLength and horz vert distance constraints

* rename equal to equalLength

* Add equalAngle constraint
2023-03-17 21:15:46 +11:00
f7c78db92b Creating new sketch calling sketch fns with dumby default values (#67) 2023-03-17 15:53:20 +11:00
c11e7e7fd3 Give startSketchAt a 3D artifact (#65)
* Give startSketchAt a 3D artifact

* fix tests

* refactor start geo to be in the start property

* small tweak
2023-03-17 08:27:40 +11:00
d73003e3fd add gradient to non-focused cursor (#63) 2023-03-16 10:33:36 +11:00
0868eaa0f7 Use shift instead of capslock for multiple line selection (#62)
Use shift instead of caplock for multiple line selection
2023-03-15 19:03:55 +11:00
d31ff80a19 add Parallel helper (#60) 2023-03-15 08:15:01 +11:00
1de21b8bdd Clean up 'prompt user for info' modals (#58) 2023-03-13 09:22:05 +11:00
eebddb0ce2 more transform functions for various line combos (#56) 2023-03-10 14:55:16 +11:00
c3ead3b074 Add Angle & Length constraint/value, and modal for the details (#54)
* setup UI for getting length and Angle values from user

* enable setLength-angle for angledLines with an exisiting constraining value
2023-03-10 08:48:50 +11:00
2bb987b3b5 Add new query for getting available variables (#52)
* Add new query for getting available variables

* use array for findAllPreviousVariables
2023-03-10 08:35:30 +11:00
d729ae3990 Add socket send for mouse events (#50)
Add socket send
2023-03-08 14:07:40 -05:00
3180702e7d quick tweak (#48) 2023-03-08 11:27:14 +11:00
8a6a11535c log stream mouse positon (#47)
* remove stream video controles

* Add mouse position logging

* clean up

* add todo

* Move mouse position into the same useEffect as the stream setup, so that it has access to socket

That will be useful when we're ready to send to the server

* make todo comment better
2023-03-08 06:12:41 +11:00
2ac24bcd95 Horz/Vert distance constraint with modal workflow (#43)
* button style tweak

* Remove duplication constraint ast transforms

* giveSketchFnCallTag to return if line already had a tag

* remove duplication

* update tag name to referenceSegName

* Update transform shape to return key details about the transform

* add modal to hor vert distance workflow

* fix browser env stuff from breaking tests

* fmt
2023-03-07 15:45:59 +11:00
a0518c556f Stream setup (#46)
* set up stream

* clean up
2023-03-06 20:13:34 +11:00
176d2d6394 initial Auth implementation (#44)
* initial implementation

* update api url
2023-03-06 18:18:01 +11:00
4c554b6549 initial set horz-vert distance constraint (#42)
inital set horz-vert distance constraint
2023-03-05 07:34:56 +11:00
433c29217e tidy up (#37) 2023-03-03 20:35:48 +11:00
6446601a67 Add equal-length constraints & implement UnaryExpressions (#35)
* add segLen help to lang std

* adding helpers functions to sketchConstraints

* update tokeniser tests because they were annoying me not being 100%

* compare async lexer with sync lexer instead

* add helper functions

* remove unneeded nesting

* update add ast modifier function for angledLine

* initial equal ast modification

It adds a tag to the primary line, and converts any secondary lines to angledLine, but doesn't reference the taged/primary line yet

* Update fn call with refernce to previous line using segLen

* add test for giveSketchFnCallTag

* fix excutor bug, executing call expression in array expression

* fix small issue in executor

* add CallExpressions to BinaryExpressions

* add unary Expressions

* tweaks to unaryExpression logic

* add recasting for unaryExpressions and CallExpressions in BinaryExpressions

* ensure pipe substitution info is passed down to unary expressions and others

* allow binary expressions in function argumentns

* inital setup, new way of organising sketch fn transforms

Starting with equal length

* overhaul equalLength button

* add equal length support for angledLine

* line with one variable supports signed legLength

* fix indentation when recasting long arrayExpressions in a pipeExpression

* improve modifyAst consision

* further modify ast tidy

* equalLength transfroms far angledLineOfXLength

* add transforms for line-yRelative

* add equal constraint for angledLineOfYLength

* quick test fix

* add equal length constrain transforms for lineTo

* add equal length constraints for angledLineToX

* add equalLength constraints for angledLineToY

* test tidy

* setup new vertical-horizontal constraints

* Add equal Length constraints for vertical/horizontal lines

* migrate old tests, and refactor callback tag

* tweaks and refactor horzVert component

* fix leg len with small negative leg length
2023-03-02 21:19:11 +11:00
f70f0f7bc3 persist code in local storage (#34)
Just a little frustrating to have code disapear on you, will probably need to be made less naive at some point
2023-02-21 14:50:22 +11:00
4ec0401118 Constraint setup + Horizontal & Vertical implementation (#33)
* start of horizontal/vert constraint

* horz vert constraint working with variable

* quick fix

* add tests for horz constraint

* clean up
2023-02-21 10:50:45 +11:00
ea05f804cc Add multi-cursor support (#30)
* update execution of callExpressions

* tweak types to store multiple cursor ranges and hook up with artifact highlighting

* multi-cursor from 3d scene

Working but has to be capslock for the time being

* tweak pannel headers

* add issue to todo comment
2023-02-21 10:28:34 +11:00
cb8e97eceb 🚨🦀 Setup Rust -> WASM 🦀🚨 (#28)
* initial tokeniser to wasm port

* fix tests

* add wasm to build script

* add rust tools to test action

* tweaks

* maybe tests will be happy

* tweak simple server

* trying to get tests to pass

* it pget vercel to build

* tidy up

* clean up rust files

* change lexer to use recursion so that it's consistent with the rest of the interpreter

* clean up nokeniser further

* rename variables

* readme typos

* run rust tests in CI

* follow clippy's advice

* more clippy clean up

* setup up proper serialzation to js-land

* tidy init promise in tests
2023-02-21 09:42:41 +11:00
594d55576a functional sketch working (#26)
* functional sketch working

With old sketch block still there

* get all version of lines working with add line and update line

* remove old ui state types

* some clean up

* rename some things

* add todo for multi cursor

* shorten useStore repitition

* small type improvement

* big overhaul to group sketch function and they ast modifying helpers together

* unneeded tweak

* ruthlessly rip out sketch logic

* clean up path keyword

* getting sketch on face working again with all the new sketch line types

* add a bunch of tests and re-arrage file structure
2023-02-12 10:56:45 +11:00
3404529743 tweak logs (#23) 2023-02-03 11:31:37 +11:00
9bb4f68794 change logs aswell (#21)
* kurt-19-change-logs-aswell

* fix tests
2023-02-03 11:09:09 +11:00
487d61b862 add memory dump panel (#20) 2023-02-03 10:04:16 +11:00
96720023db clean up panels a little (#18) 2023-02-02 20:41:28 +11:00
29e06ec852 Add non-code metadata to the ast (#15)
* Revert "wire up comments to ui (#11)"

This reverts commit bdf778530f.

* Revert "Add the ability to recast comments and some whitespace (#10)"

This reverts commit dd5022b38e.

* ast metadata

* clean up
2023-02-01 07:30:55 +11:00
bdf778530f wire up comments to ui (#11) 2023-01-24 21:09:00 +11:00
dd5022b38e Add the ability to recast comments and some whitespace (#10)
* Add the ability to recast comments and some whitespace

Currently because whitespace or anything that's not needed for execution is not stored in the AST, it's hard to respect things like user formatting when recasting.

I think having a by-default-opinioned formatter is a good thing, but where this becomes problematic is when users wants to simply leave a blank space between some lines for a bit of breathing room, a code paragraph if you will, but maybe more importantly comments have not been implemented for the same reason, there wasn't a way with the current setup to insert them back in.

In some ways the most straightforward way to do this is to put whitespace and comments into the AST. Even though they are not crucial for execution, code-gen/recasting needs to be a first-class citizen in this lang so that's probably the long-term solution. However I'm trying to draw inspiration from other languages, and since it's not the norm to put comments et-al into the AST I haven't done so.

Because whitespace is tokenised already if not transformed into the AST, there is somewhat of a map of these things without going back to source code, so atm I'm experimenting with using this to insert extra linebreaks and comments back in between statements. I think this is a good compromise for the time being for what is a nice to have feature atm.

Because it's only going to respect non-code parts in between statements this will mean that you can't format objects or function params how you like (but I think this is good to have an opinioned fmt out of the box) and comments like myFunctionCall('a', /* inline comment */ b) will not work either.

* clean up
2023-01-23 14:50:58 +11:00