Cube example didn't actually work (#1478)
* Cube example didn't actually work * Bump h2 in fuzz tests
This commit is contained in:
		@ -1047,14 +1047,7 @@ fn store_object_with_array_property() {
 | 
			
		||||
#[ignore = "haven't done API calls or stdlib yet"]
 | 
			
		||||
#[test]
 | 
			
		||||
fn stdlib_api_calls() {
 | 
			
		||||
    let program = "const x0 = startSketchAt([0, 0])
 | 
			
		||||
        const x1 = line([0, 10], x0)
 | 
			
		||||
        const x2 = line([10, 0], x1)
 | 
			
		||||
        const x3 = line([0, -10], x2)
 | 
			
		||||
        const x4 = line([0, 0], x3)
 | 
			
		||||
        const x5 = close(x4)
 | 
			
		||||
        const x6 = extrude(20, x5)
 | 
			
		||||
      show(x6)";
 | 
			
		||||
    let program = include_str!("../../tests/executor/inputs/cube.kcl");
 | 
			
		||||
    must_plan(program);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										841
									
								
								src/wasm-lib/kcl/fuzz/Cargo.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										841
									
								
								src/wasm-lib/kcl/fuzz/Cargo.lock
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -1,12 +1,20 @@
 | 
			
		||||
fn cube = (pos, scale) => {
 | 
			
		||||
  const sg = startSketchAt(pos)
 | 
			
		||||
    |> line([0, scale], %)
 | 
			
		||||
    |> line([scale, 0], %)
 | 
			
		||||
    |> line([0, -scale], %)
 | 
			
		||||
 | 
			
		||||
  return sg
 | 
			
		||||
fn cube = (length, center) => {
 | 
			
		||||
  let l = length/2
 | 
			
		||||
  let x = center[0]
 | 
			
		||||
  let y = center[1]
 | 
			
		||||
  let p0 = [-l + x, -l + y]
 | 
			
		||||
  let p1 = [-l + x,  l + y]
 | 
			
		||||
  let p2 = [ l + x,  l + y]
 | 
			
		||||
  let p3 = [ l + x, -l + y]
 | 
			
		||||
  
 | 
			
		||||
  return startSketchAt(p0)
 | 
			
		||||
  |> lineTo(p1, %)
 | 
			
		||||
  |> lineTo(p2, %)
 | 
			
		||||
  |> lineTo(p3, %)
 | 
			
		||||
  |> lineTo(p0, %)
 | 
			
		||||
  |> close(%)
 | 
			
		||||
  |> extrude(length, %)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const b1 = cube([0,0], 10)
 | 
			
		||||
const pt1 = b1[0]
 | 
			
		||||
show(b1)
 | 
			
		||||
const myCube = cube(40, [0,0])
 | 
			
		||||
show(myCube)
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user