Files
modeling-app/rust/kcl-lib/tests/bad_units_in_annotation/unparsed.snap
Nick Cameron e8feb0309b Automatic fixing of deprecations and use non-quoted default planes by default (#5902)
* Automatic fixing of deprecations and use non-quoted default planes by default

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-21 09:39:12 +00:00

33 lines
1.1 KiB
Plaintext

---
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing bad_units_in_annotation.kcl
---
@settings(defaultLengthUnit = nm)
// Generated by Text-to-CAD: draw a water molecule
// Constants for the water molecule
oxygenRadius = 0.066 // Approximate radius of an oxygen atom
hydrogenRadius = 0.053 // Approximate radius of a hydrogen atom
oxygenHydrogenDistance = 0.096 // Approximate distance between oxygen and hydrogen atoms
bondAngle = 104.5 // Bond angle in degrees
// Function to create a sphere representing an atom
fn createAtom(center, radius) {
return startSketchOn(XY)
|> circle(center = center, radius = radius)
|> extrude(length = radius * 2)
}
// Create the oxygen atom at the origin
oxygenAtom = createAtom([0, 0], oxygenRadius)
// Calculate the positions of the hydrogen atoms
hydrogenOffsetX = oxygenHydrogenDistance * cos(toRadians(bondAngle / 2))
hydrogenOffsetY = oxygenHydrogenDistance * sin(toRadians(bondAngle / 2))
// Create the hydrogen atoms
hydrogenAtom1 = createAtom([hydrogenOffsetX, hydrogenOffsetY], hydrogenRadius)
hydrogenAtom2 = createAtom([-hydrogenOffsetX, hydrogenOffsetY], hydrogenRadius)