Skip to content

KCL: Geometry debug tests - #12450

Open
adamchalmers wants to merge 2 commits into
mainfrom
achalmers/geo-dbg
Open

KCL: Geometry debug tests#12450
adamchalmers wants to merge 2 commits into
mainfrom
achalmers/geo-dbg

Conversation

@adamchalmers

@adamchalmers adamchalmers commented Jul 14, 2026

Copy link
Copy Markdown
Contributor
cargo nextest run -p kcl-lib --nocapture -- geo_dbg::tests::simple_rectangle

should output data about the profiles in a KCL program, including how they're represented in KCL, in the engine, and in toolpaths.

It looks like this:

demo

The OBJ data can be copied into the toolpaths repo and interactively viewed in their debugging tools.

Once this has been used a bit, and proven to be useful, we'll port it to the CLI. That way customers can use this and send us redacted data, or so that we can run it in a customer environment.

Part of #12477

@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
modeling-app Ready Ready Preview, Comment Jul 16, 2026 7:41pm

Request Review

@adamchalmers

Copy link
Copy Markdown
Contributor Author

So far when you run

cargo nextest run -p kcl-lib --nocapture -- geo_dbg::tests::simple_rectangle

you get:

Running rectangle/tests/rectangle/input.kcl
Details of sketch001:
line1
  Type: Line
  Start: (-10), (-10)
  End: (40), (-10)
line2
  Type: Line
  Start: (40), (-10)
  End: (40), (90)
line3
  Type: Line
  Start: (40), (90)
  End: (-10), (90)
line4
  Type: Line
  Start: (-10), (90)
  End: (-10), (-10)
ID: 7b681387-29ea-57f1-8713-d63280827139

@adamchalmers

adamchalmers commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Now you get a nicer table, and it shows both the KCL view of each segment, and the Engine view.

Running rectangle/tests/rectangle/input.kcl
Sketch ID: 7b681387-29ea-57f1-8713-d63280827139
┌───────────────┬──────────────┬────────────┬────────────┬──────────────┬────────────┐
│ Variable name │ Segment kind │ KCL start  │ KCL end    │ Engine start │ Engine end │
├───────────────┼──────────────┼────────────┼────────────┼──────────────┼────────────┤
│ line1         │ Line         │ (-10, -10) │ (40, -10)  │ (-10, -10)   │ (40, -10)  │
├───────────────┼──────────────┼────────────┼────────────┼──────────────┼────────────┤
│ line2         │ Line         │ (40, -10)  │ (40, 90)   │ (40, -10)    │ (40, 90)   │
├───────────────┼──────────────┼────────────┼────────────┼──────────────┼────────────┤
│ line3         │ Line         │ (40, 90)   │ (-10, 90)  │ (40, 90)     │ (-10, 90)  │
├───────────────┼──────────────┼────────────┼────────────┼──────────────┼────────────┤
│ line4         │ Line         │ (-10, 90)  │ (-10, -10) │ (-10, 90)    │ (-10, -10) │
└───────────────┴──────────────┴────────────┴────────────┴──────────────┴────────────┘

@codspeed-hq

codspeed-hq Bot commented Jul 15, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 126 untouched benchmarks
⏩ 151 skipped benchmarks1


Comparing achalmers/geo-dbg (4251216) with main (4f69d73)

Open in CodSpeed

Footnotes

  1. 151 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Goal: show how a profile is represented in KCL, engine, toolpaths.

Currently it shows the KCL representation.
#[tokio::test]
async fn simple_rectangle() {
let test = Test::new("rectangle", "sketch001");
execute_test(&test).await;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to assert any of the data this prints? Or is this more of a testing debug module?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more of a test that it all works and can receive the data, I don't care about the specific data found here.

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