Skip to content

Add Pen tool support for starting and ending segment drawing on existing path edges for vector meshes #2692

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jun 14, 2025

Conversation

4adex
Copy link
Collaborator

@4adex 4adex commented Jun 5, 2025

Described in detail here -
image

@4adex 4adex changed the title Pen tool can start and end on segment by pressing Alt (Vector meshes) Pen tool can start and end on segment (Vector meshes) Jun 7, 2025
Copy link

github-actions bot commented Jun 7, 2025

Performance Benchmark Results

compile_demo_art_iai::compile_group::compile_to_proto with_setup_0:load_from_name(isometric-fountain)
Instructions: 25,053,934 (master) -> 25,037,438 (HEAD) : $$\color{lime}-0.07\%$$

Detailed metrics
Baselines:                master|       HEAD
D1mr                     310,514|    310,087          -0.14%
D1mw                      98,901|     98,611          -0.29%
DLmr                      28,669|     28,558          -0.39%
DLmw                      37,766|     33,002         -12.61%
Dr                     6,027,945|  6,021,403          -0.11%
Dw                     4,266,881|  4,265,298          -0.04%
EstimatedCycles       39,195,272| 39,017,951          -0.45%
I1mr                      47,523|     46,530          -2.09%
ILmr                         857|        870          +1.52%
Ir                    25,053,934| 25,037,438          -0.07%
L1hits                34,891,822| 34,868,911          -0.07%
LLhits                   389,646|    392,798          +0.81%
RamHits                   67,292|     62,430          -7.23%
TotalRW               35,348,760| 35,324,139          -0.07%

compile_demo_art_iai::compile_group::compile_to_proto with_setup_1:load_from_name(painted-dreams)
Instructions: 12,248,074 (master) -> 12,242,071 (HEAD) : $$\color{lime}-0.05\%$$

Detailed metrics
Baselines:                master|       HEAD
D1mr                     145,454|    145,736          +0.19%
D1mw                      46,856|     47,085          +0.49%
DLmr                         349|        308         -11.75%
DLmw                      14,997|     14,669          -2.19%
Dr                     2,946,357|  2,943,646          -0.09%
Dw                     2,077,380|  2,076,545          -0.04%
EstimatedCycles       18,611,217| 18,591,848          -0.10%
I1mr                      21,949|     21,788          -0.73%
ILmr                         733|        728          -0.68%
Ir                    12,248,074| 12,242,071          -0.05%
L1hits                17,057,552| 17,047,653          -0.06%
LLhits                   198,180|    198,904          +0.37%
RamHits                   16,079|     15,705          -2.33%
TotalRW               17,271,811| 17,262,262          -0.06%

compile_demo_art_iai::compile_group::compile_to_proto with_setup_2:load_from_name(procedural-string-lights)
Instructions: 3,463,123 (master) -> 2,649,941 (HEAD) : $$\color{lime}-23.48\%$$

Detailed metrics
Baselines:                master|       HEAD
D1mr                      40,435|     27,274         -32.55%
D1mw                      12,753|     12,390          -2.85%
DLmr                          19|         21         +10.53%
DLmw                       3,786|      2,605         -31.19%
Dr                       823,652|    609,111         -26.05%
Dw                       581,606|    445,664         -23.37%
EstimatedCycles        5,242,995|  3,989,046         -23.92%
I1mr                       6,453|      6,316          -2.12%
ILmr                         730|        721          -1.23%
Ir                     3,463,123|  2,649,941         -23.48%
L1hits                 4,808,740|  3,658,736         -23.91%
LLhits                    55,106|     42,633         -22.63%
RamHits                    4,535|      3,347         -26.20%
TotalRW                4,868,381|  3,704,716         -23.90%

compile_demo_art_iai::compile_group::compile_to_proto with_setup_3:load_from_name(parametric-dunescape)
Instructions: 12,494,141 (master) -> 12,496,380 (HEAD) : $$\color{red}+0.02\%$$

Detailed metrics
Baselines:                master|       HEAD
D1mr                     152,919|    152,360          -0.37%
D1mw                      50,229|     50,206          -0.05%
DLmr                          40|         41          +2.50%
DLmw                      12,064|     12,136          +0.60%
Dr                     2,974,301|  2,972,649          -0.06%
Dw                     2,123,641|  2,124,344          +0.03%
EstimatedCycles       18,873,845| 18,877,627          +0.02%
I1mr                      20,100|     20,825          +3.61%
ILmr                         855|        846          -1.05%
Ir                    12,494,141| 12,496,380          +0.02%
L1hits                17,368,835| 17,369,982          +0.01%
LLhits                   210,289|    210,368          +0.04%
RamHits                   12,959|     13,023          +0.49%
TotalRW               17,592,083| 17,593,373          +0.01%

compile_demo_art_iai::compile_group::compile_to_proto with_setup_4:load_from_name(red-dress)
Instructions: 29,984,423 (master) -> 29,980,856 (HEAD) : $$\color{lime}-0.01\%$$

Detailed metrics
Baselines:                master|       HEAD
D1mr                     382,633|    382,829          +0.05%
D1mw                     126,829|    127,144          +0.25%
DLmr                      40,767|     40,731          -0.09%
DLmw                      65,383|     63,897          -2.27%
Dr                     7,152,616|  7,152,397          -0.00%
Dw                     5,073,255|  5,075,111          +0.04%
EstimatedCycles       47,663,352| 47,617,680          -0.10%
I1mr                      51,250|     51,046          -0.40%
ILmr                         857|        880          +2.68%
Ir                    29,984,423| 29,980,856          -0.01%
L1hits                41,649,582| 41,647,345          -0.01%
LLhits                   453,705|    455,511          +0.40%
RamHits                  107,007|    105,508          -1.40%
TotalRW               42,210,294| 42,208,364          -0.00%

compile_demo_art_iai::compile_group::compile_to_proto with_setup_5:load_from_name(valley-of-spires)
Instructions: 19,008,472 (master) -> 19,007,892 (HEAD) : $$\color{lime}-0.00\%$$

Detailed metrics
Baselines:                master|       HEAD
D1mr                     235,863|    235,374          -0.21%
D1mw                      76,738|     76,965          +0.30%
DLmr                      12,248|     12,184          -0.52%
DLmw                      28,485|     29,065          +2.04%
Dr                     4,558,854|  4,557,158          -0.04%
Dw                     3,228,408|  3,228,701          +0.01%
EstimatedCycles       29,431,742| 29,444,183          +0.04%
I1mr                      35,121|     35,059          -0.18%
ILmr                         771|        779          +1.04%
Ir                    19,008,472| 19,007,892          -0.00%
L1hits                26,448,012| 26,446,353          -0.01%
LLhits                   306,218|    305,370          -0.28%
RamHits                   41,504|     42,028          +1.26%
TotalRW               26,795,734| 26,793,751          -0.01%

Copy link

github-actions bot commented Jun 7, 2025

Performance Benchmark Results

compile_demo_art_iai::compile_group::compile_to_proto with_setup_0:load_from_name(isometric-fountain)
Instructions: 25,054,003 (master) -> 25,034,363 (HEAD) : $$\color{lime}-0.08\%$$

Detailed metrics
Baselines:                master|       HEAD
D1mr                     311,249|    310,421          -0.27%
D1mw                      98,875|     98,642          -0.24%
DLmr                      28,725|     28,560          -0.57%
DLmw                      39,686|     32,992         -16.87%
Dr                     6,027,188|  6,021,139          -0.10%
Dw                     4,266,329|  4,265,417          -0.02%
EstimatedCycles       39,239,970| 39,015,951          -0.57%
I1mr                      43,411|     46,530          +7.18%
ILmr                         866|        870          +0.46%
Ir                    25,054,003| 25,034,363          -0.08%
L1hits                34,893,985| 34,865,326          -0.08%
LLhits                   384,258|    393,171          +2.32%
RamHits                   69,277|     62,422          -9.90%
TotalRW               35,347,520| 35,320,919          -0.08%

compile_demo_art_iai::compile_group::compile_to_proto with_setup_1:load_from_name(painted-dreams)
Instructions: 13,045,376 (master) -> 12,241,873 (HEAD) : $$\color{lime}-6.16\%$$

Detailed metrics
Baselines:                master|       HEAD
D1mr                     155,579|    145,730          -6.33%
D1mw                      49,735|     47,078          -5.34%
DLmr                         706|        304         -56.94%
DLmw                      13,117|     14,672         +11.85%
Dr                     3,138,023|  2,943,633          -6.19%
Dw                     2,212,814|  2,076,562          -6.16%
EstimatedCycles       19,741,061| 18,591,572          -5.82%
I1mr                      21,743|     21,788          +0.21%
ILmr                         731|        728          -0.41%
Ir                    13,045,376| 12,241,873          -6.16%
L1hits                18,169,156| 17,047,472          -6.17%
LLhits                   212,503|    198,892          -6.41%
RamHits                   14,554|     15,704          +7.90%
TotalRW               18,396,213| 17,262,068          -6.17%

compile_demo_art_iai::compile_group::compile_to_proto with_setup_2:load_from_name(procedural-string-lights)
Instructions: 2,158,017 (master) -> 2,649,432 (HEAD) : $$\color{red}+22.77\%$$

Detailed metrics
Baselines:                master|       HEAD
D1mr                      22,313|     27,254         +22.14%
D1mw                      10,508|     12,407         +18.07%
DLmr                          17|         21         +23.53%
DLmw                       2,456|      2,608          +6.19%
Dr                       494,361|    609,061         +23.20%
Dw                       361,319|    445,626         +23.33%
EstimatedCycles        3,259,799|  3,988,527         +22.35%
I1mr                       4,862|      6,316         +29.91%
ILmr                         706|        721          +2.12%
Ir                     2,158,017|  2,649,432         +22.77%
L1hits                 2,976,014|  3,658,142         +22.92%
LLhits                    34,504|     42,627         +23.54%
RamHits                    3,179|      3,350          +5.38%
TotalRW                3,013,697|  3,704,119         +22.91%

compile_demo_art_iai::compile_group::compile_to_proto with_setup_3:load_from_name(parametric-dunescape)
Instructions: 12,499,784 (master) -> 12,496,167 (HEAD) : $$\color{lime}-0.03\%$$

Detailed metrics
Baselines:                master|       HEAD
D1mr                     152,161|    152,350          +0.12%
D1mw                      50,187|     50,202          +0.03%
DLmr                          45|         40         -11.11%
DLmw                      12,045|     12,141          +0.80%
Dr                     2,974,210|  2,972,745          -0.05%
Dw                     2,123,972|  2,124,440          +0.02%
EstimatedCycles       18,872,154| 18,877,670          +0.03%
I1mr                      19,209|     20,825          +8.41%
ILmr                         842|        846          +0.48%
Ir                    12,499,784| 12,496,167          -0.03%
L1hits                17,376,409| 17,369,975          -0.04%
LLhits                   208,625|    210,350          +0.83%
RamHits                   12,932|     13,027          +0.73%
TotalRW               17,597,966| 17,593,352          -0.03%

compile_demo_art_iai::compile_group::compile_to_proto with_setup_4:load_from_name(red-dress)
Instructions: 29,983,049 (master) -> 29,977,567 (HEAD) : $$\color{lime}-0.02\%$$

Detailed metrics
Baselines:                master|       HEAD
D1mr                     381,174|    382,598          +0.37%
D1mw                     126,641|    127,037          +0.31%
DLmr                      40,786|     40,730          -0.14%
DLmw                      62,585|     63,914          +2.12%
Dr                     7,152,729|  7,151,836          -0.01%
Dw                     5,072,389|  5,075,027          +0.05%
EstimatedCycles       47,556,715| 47,612,836          +0.12%
I1mr                      47,537|     51,044          +7.38%
ILmr                         867|        879          +1.38%
Ir                    29,983,049| 29,977,567          -0.02%
L1hits                41,652,815| 41,643,751          -0.02%
LLhits                   451,114|    455,156          +0.90%
RamHits                  104,238|    105,523          +1.23%
TotalRW               42,208,167| 42,204,430          -0.01%

compile_demo_art_iai::compile_group::compile_to_proto with_setup_5:load_from_name(valley-of-spires)
Instructions: 19,009,951 (master) -> 19,008,624 (HEAD) : $$\color{lime}-0.01\%$$

Detailed metrics
Baselines:                master|       HEAD
D1mr                     234,608|    235,435          +0.35%
D1mw                      76,047|     76,971          +1.22%
DLmr                      12,278|     12,175          -0.84%
DLmw                      29,050|     29,053          +0.01%
Dr                     4,558,828|  4,557,278          -0.03%
Dw                     3,228,409|  3,228,696          +0.01%
EstimatedCycles       29,434,814| 29,444,668          +0.03%
I1mr                      32,994|     35,059          +6.26%
ILmr                         773|        779          +0.78%
Ir                    19,009,951| 19,008,624          -0.01%
L1hits                26,453,539| 26,447,133          -0.02%
LLhits                   301,548|    305,458          +1.30%
RamHits                   42,101|     42,007          -0.22%
TotalRW               26,797,188| 26,794,598          -0.01%

@Keavon
Copy link
Member

Keavon commented Jun 9, 2025

UX concern: when we're snapping to an anchor, we also appear to be showing the new insertion point underneath the cursor which incorrectly and confusingly implies that we'd insert a point where, when in reality we are (correctly) snapping to the nearby anchor:

capture_15_.mp4

@Keavon Keavon marked this pull request as draft June 10, 2025 00:41
@Keavon Keavon changed the title Pen tool can start and end on segment (Vector meshes) Add Pen tool support for starting and ending segment drawing on existing path edges for vector meshes Jun 14, 2025
@Keavon Keavon enabled auto-merge (squash) June 14, 2025 22:38
@Keavon Keavon merged commit d080c05 into master Jun 14, 2025
4 checks passed
@Keavon Keavon deleted the pen_tool_start_and_end_on_segment branch June 14, 2025 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants