* 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>
		
			
				
	
	
		
			33 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			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)
 |