Previously, `xLine`, `xLineTo`, `yLine` and `yLineTo` used positional arguments. Now: - `xLineTo` and `yLineTo` have been removed - `xLine` and `yLine` both use keyword arguments: - `length`, optional (i.e. a relative distance along the X or Y axis) - `endAbsolute` optional (i.e. an absolute point along the X or Y axis) - `tag` optional - Exactly one of `length` or `endAbsolute` must be given. Not both, not neither. For example: ``` // Old way |> xLine(6.04, %) |> yLineTo(20, %, $base) // New way |> xLine(length = 6.04) |> yLine(endAbsolute = 20, tag = $base) ``` This also improves some of the general-purpose keyword arguments code in modeling app's TS codebase.
		
			
				
	
	
		
			23 lines
		
	
	
		
			681 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			681 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
// I-beam
 | 
						|
// A structural metal beam with an I shaped cross section. Often used in construction
 | 
						|
 | 
						|
// Set Units
 | 
						|
@settings(defaultLengthUnit = in)
 | 
						|
 | 
						|
//Define Beam Dimensions
 | 
						|
beamLength = 24
 | 
						|
beamWidth = 2.663
 | 
						|
beamHeight = 4
 | 
						|
wallThickness = 0.293
 | 
						|
 | 
						|
// Sketch a quadrant of the beam cross section, then mirror for symmetry across each axis. Extrude to the appropriate length
 | 
						|
sketch001 = startSketchOn('-XZ')
 | 
						|
  |> startProfileAt([0, beamHeight/2], %)
 | 
						|
  |> xLine(length = beamWidth/2)
 | 
						|
  |> yLine(length = -wallThickness)
 | 
						|
  |> xLine(endAbsolute = wallThickness/2)
 | 
						|
  |> yLine(endAbsolute = 0)
 | 
						|
  |> mirror2d({ axis = 'X' }, %)
 | 
						|
  |> mirror2d({ axis = 'Y' }, %)
 | 
						|
  |> extrude(length = beamLength)
 |