Another project
0

Configure Feed

Select the types of activity you want to include in your feed.

at main 17 kB View raw
1use bone_types::{Angle, IconId, LinearRgba, degree}; 2 3use crate::icon::{IconMaterial, IconModel, IconView, Prim, Rotation}; 4 5const STEEL: LinearRgba = LinearRgba::new(0.20, 0.32, 0.52, 1.0); 6const STEEL_LIGHT: LinearRgba = LinearRgba::new(0.42, 0.54, 0.72, 1.0); 7const AMBER: LinearRgba = LinearRgba::new(0.86, 0.42, 0.06, 1.0); 8const AMBER_LIGHT: LinearRgba = LinearRgba::new(0.95, 0.62, 0.18, 1.0); 9const GREEN: LinearRgba = LinearRgba::new(0.20, 0.50, 0.22, 1.0); 10const RED: LinearRgba = LinearRgba::new(0.62, 0.13, 0.10, 1.0); 11const GRAY: LinearRgba = LinearRgba::new(0.52, 0.54, 0.58, 1.0); 12const LIGHT: LinearRgba = LinearRgba::new(0.82, 0.85, 0.90, 1.0); 13const DARK: LinearRgba = LinearRgba::new(0.12, 0.14, 0.18, 1.0); 14const WHITE: LinearRgba = LinearRgba::new(1.0, 1.0, 1.0, 1.0); 15const AX_X: LinearRgba = LinearRgba::new(0.72, 0.16, 0.12, 1.0); 16const AX_Y: LinearRgba = LinearRgba::new(0.16, 0.56, 0.20, 1.0); 17const AX_Z: LinearRgba = LinearRgba::new(0.16, 0.30, 0.70, 1.0); 18 19const BAR: f32 = 0.09; 20const TUBE: f32 = 0.075; 21const DOT: f32 = 0.16; 22const DOT_SM: f32 = 0.1; 23 24#[must_use] 25pub fn model(id: IconId) -> IconModel { 26 let prims = match id { 27 IconId::Point => point(), 28 IconId::Line => line(), 29 IconId::CenterpointArc => centerpoint_arc(), 30 IconId::TangentArc => tangent_arc(), 31 IconId::ThreePointArc => three_point_arc(), 32 IconId::Circle => circle(), 33 IconId::PerimeterCircle => perimeter_circle(), 34 IconId::CornerRectangle => corner_rectangle(), 35 IconId::CenterRectangle => center_rectangle(), 36 IconId::ThreePointCornerRectangle => three_point_corner_rectangle(), 37 IconId::ThreePointCenterRectangle => three_point_center_rectangle(), 38 IconId::Parallelogram => parallelogram(), 39 IconId::SmartDimension => smart_dimension(), 40 IconId::Coincident => coincident(), 41 IconId::Horizontal => horizontal(), 42 IconId::Vertical => vertical(), 43 IconId::Parallel => parallel(), 44 IconId::Perpendicular => perpendicular(), 45 IconId::Tangent => tangent(), 46 IconId::Equal => equal(), 47 IconId::Concentric => concentric(), 48 IconId::Midpoint => midpoint(), 49 IconId::Symmetric => symmetric(), 50 IconId::Fix => fix(), 51 IconId::ExtrudedBossBase => extruded_boss_base(), 52 IconId::ExtrudedCut => extruded_cut(), 53 IconId::TreeFeature => tree_feature(), 54 IconId::TreePlane => tree_plane(), 55 IconId::TreeSketch => tree_sketch(), 56 IconId::TreeOrigin => tree_origin(), 57 IconId::TabTree => tab_tree(), 58 IconId::TabProperties => tab_properties(), 59 IconId::TabConfiguration => tab_configuration(), 60 IconId::TabDimensionExpert => tab_dimension_expert(), 61 IconId::TabDisplay => tab_display(), 62 IconId::ZoomToFit => zoom_to_fit(), 63 IconId::ZoomToArea => zoom_to_area(), 64 IconId::PreviousView => previous_view(), 65 IconId::SectionView => section_view(), 66 IconId::ViewOrientation => view_orientation(), 67 IconId::DisplayStyle => display_style(), 68 IconId::HideShowItems => hide_show_items(), 69 IconId::EditAppearance => edit_appearance(), 70 IconId::ViewSettings => view_settings(), 71 IconId::Check => check(), 72 IconId::Cross => cross(), 73 }; 74 IconModel::new(prims).with_view(view_for(id)) 75} 76 77fn view_for(id: IconId) -> IconView { 78 match id { 79 IconId::ExtrudedBossBase 80 | IconId::ExtrudedCut 81 | IconId::TreeFeature 82 | IconId::TreePlane 83 | IconId::TreeOrigin 84 | IconId::SectionView 85 | IconId::ViewOrientation 86 | IconId::DisplayStyle 87 | IconId::TabConfiguration 88 | IconId::TabDisplay 89 | IconId::EditAppearance => IconView::Iso, 90 _ => IconView::Front, 91 } 92} 93 94fn mat(color: LinearRgba) -> IconMaterial { 95 IconMaterial::new(color) 96} 97 98fn z0(p: [f32; 2]) -> [f32; 3] { 99 [p[0], p[1], 0.0] 100} 101 102fn bar(a: [f32; 2], b: [f32; 2], radius: f32, color: LinearRgba) -> Prim { 103 Prim::bar(z0(a), z0(b), radius, mat(color)) 104} 105 106fn dot(p: [f32; 2], radius: f32, color: LinearRgba) -> Prim { 107 Prim::ball(z0(p), radius, mat(color)) 108} 109 110fn circle_path(center: [f32; 2], radius: f32, n: u16) -> Vec<[f32; 3]> { 111 (0..n) 112 .map(|i| { 113 let t = core::f32::consts::TAU * f32::from(i) / f32::from(n); 114 [ 115 center[0] + radius * t.cos(), 116 center[1] + radius * t.sin(), 117 0.0, 118 ] 119 }) 120 .collect() 121} 122 123fn arc_path( 124 center: [f32; 2], 125 radius: f32, 126 start_deg: f32, 127 sweep_deg: f32, 128 n: u16, 129) -> Vec<[f32; 3]> { 130 let start = start_deg.to_radians(); 131 let sweep = sweep_deg.to_radians(); 132 (0..=n) 133 .map(|i| { 134 let t = start + sweep * f32::from(i) / f32::from(n); 135 [ 136 center[0] + radius * t.cos(), 137 center[1] + radius * t.sin(), 138 0.0, 139 ] 140 }) 141 .collect() 142} 143 144fn ring(center: [f32; 2], radius: f32, tube: f32, color: LinearRgba) -> Prim { 145 Prim::loop_tube(circle_path(center, radius, 48), tube, mat(color)) 146} 147 148fn arc( 149 center: [f32; 2], 150 radius: f32, 151 start_deg: f32, 152 sweep_deg: f32, 153 tube: f32, 154 color: LinearRgba, 155) -> Prim { 156 Prim::open_tube( 157 arc_path(center, radius, start_deg, sweep_deg, 24), 158 tube, 159 mat(color), 160 ) 161} 162 163fn rotate2(p: [f32; 2], angle_deg: f32) -> [f32; 2] { 164 let r = angle_deg.to_radians(); 165 [ 166 p[0] * r.cos() - p[1] * r.sin(), 167 p[0] * r.sin() + p[1] * r.cos(), 168 ] 169} 170 171fn rect(corners: [[f32; 2]; 4], tube: f32, color: LinearRgba) -> Prim { 172 Prim::loop_tube(corners.into_iter().map(z0).collect(), tube, mat(color)) 173} 174 175fn tilted_rect(half_w: f32, half_h: f32, angle_deg: f32, tube: f32, color: LinearRgba) -> Prim { 176 let corners = [ 177 rotate2([-half_w, -half_h], angle_deg), 178 rotate2([half_w, -half_h], angle_deg), 179 rotate2([half_w, half_h], angle_deg), 180 rotate2([-half_w, half_h], angle_deg), 181 ]; 182 rect(corners, tube, color) 183} 184 185fn turn(value_deg: f32) -> Angle { 186 Angle::new::<degree>(f64::from(value_deg)) 187} 188 189fn point() -> Vec<Prim> { 190 vec![ 191 dot([0.0, 0.0], 0.24, STEEL), 192 bar([-0.6, 0.0], [0.6, 0.0], 0.04, AMBER), 193 bar([0.0, -0.6], [0.0, 0.6], 0.04, AMBER), 194 ] 195} 196 197fn line() -> Vec<Prim> { 198 vec![ 199 bar([-0.7, -0.5], [0.7, 0.5], BAR, STEEL), 200 dot([-0.7, -0.5], DOT_SM, AMBER), 201 dot([0.7, 0.5], DOT_SM, AMBER), 202 ] 203} 204 205fn centerpoint_arc() -> Vec<Prim> { 206 vec![ 207 arc([0.0, -0.35], 0.78, 30.0, 120.0, TUBE, STEEL), 208 dot([0.0, -0.35], DOT, AMBER), 209 bar([0.0, -0.35], [-0.675, 0.04], 0.045, STEEL_LIGHT), 210 ] 211} 212 213fn tangent_arc() -> Vec<Prim> { 214 vec![ 215 bar([-0.8, -0.55], [-0.1, -0.55], BAR, STEEL), 216 arc([-0.1, 0.05], 0.6, -90.0, 95.0, TUBE, AMBER), 217 ] 218} 219 220fn three_point_arc() -> Vec<Prim> { 221 vec![ 222 arc([0.0, -0.45], 0.85, 30.0, 120.0, TUBE, STEEL), 223 dot([-0.736, 0.025], DOT_SM, AMBER), 224 dot([0.736, 0.025], DOT_SM, AMBER), 225 dot([0.0, 0.4], DOT_SM, AMBER), 226 ] 227} 228 229fn circle() -> Vec<Prim> { 230 vec![ 231 ring([0.0, 0.0], 0.7, TUBE, STEEL), 232 dot([0.0, 0.0], DOT_SM, STEEL_LIGHT), 233 ] 234} 235 236fn perimeter_circle() -> Vec<Prim> { 237 vec![ 238 ring([0.0, 0.0], 0.7, TUBE, STEEL), 239 dot([0.0, 0.7], DOT_SM, AMBER), 240 dot([-0.606, -0.35], DOT_SM, AMBER), 241 dot([0.606, -0.35], DOT_SM, AMBER), 242 ] 243} 244 245fn corner_rectangle() -> Vec<Prim> { 246 vec![ 247 rect( 248 [[-0.7, -0.5], [0.7, -0.5], [0.7, 0.5], [-0.7, 0.5]], 249 TUBE, 250 STEEL, 251 ), 252 dot([-0.7, -0.5], DOT_SM, AMBER), 253 dot([0.7, 0.5], DOT_SM, AMBER), 254 ] 255} 256 257fn center_rectangle() -> Vec<Prim> { 258 vec![ 259 rect( 260 [[-0.7, -0.5], [0.7, -0.5], [0.7, 0.5], [-0.7, 0.5]], 261 TUBE, 262 STEEL, 263 ), 264 dot([0.0, 0.0], DOT_SM, AMBER), 265 ] 266} 267 268fn three_point_corner_rectangle() -> Vec<Prim> { 269 let lower_left = rotate2([-0.72, -0.46], 18.0); 270 let upper_right = rotate2([0.72, 0.46], 18.0); 271 vec![ 272 tilted_rect(0.72, 0.46, 18.0, TUBE, STEEL), 273 dot(lower_left, DOT_SM, AMBER), 274 dot(upper_right, DOT_SM, AMBER), 275 ] 276} 277 278fn three_point_center_rectangle() -> Vec<Prim> { 279 vec![ 280 tilted_rect(0.72, 0.46, 18.0, TUBE, STEEL), 281 dot([0.0, 0.0], DOT_SM, AMBER), 282 ] 283} 284 285fn parallelogram() -> Vec<Prim> { 286 vec![rect( 287 [[-0.8, -0.5], [0.4, -0.5], [0.8, 0.5], [-0.4, 0.5]], 288 TUBE, 289 STEEL, 290 )] 291} 292 293fn smart_dimension() -> Vec<Prim> { 294 vec![ 295 bar([-0.6, -0.7], [-0.6, 0.25], 0.05, STEEL_LIGHT), 296 bar([0.6, -0.7], [0.6, 0.25], 0.05, STEEL_LIGHT), 297 Prim::arrow( 298 z0([-0.05, -0.2]), 299 z0([-0.6, -0.2]), 300 0.05, 301 0.16, 302 0.22, 303 mat(AMBER), 304 ), 305 Prim::arrow( 306 z0([0.05, -0.2]), 307 z0([0.6, -0.2]), 308 0.05, 309 0.16, 310 0.22, 311 mat(AMBER), 312 ), 313 ] 314} 315 316fn coincident() -> Vec<Prim> { 317 vec![ 318 ring([0.0, 0.0], 0.62, TUBE, STEEL), 319 dot([0.0, 0.0], 0.24, AMBER), 320 ] 321} 322 323fn horizontal() -> Vec<Prim> { 324 vec![ 325 bar([-0.78, 0.0], [0.78, 0.0], 0.11, AMBER), 326 dot([-0.78, 0.0], DOT_SM, STEEL), 327 dot([0.78, 0.0], DOT_SM, STEEL), 328 ] 329} 330 331fn vertical() -> Vec<Prim> { 332 vec![ 333 bar([0.0, -0.78], [0.0, 0.78], 0.11, AMBER), 334 dot([0.0, -0.78], DOT_SM, STEEL), 335 dot([0.0, 0.78], DOT_SM, STEEL), 336 ] 337} 338 339fn parallel() -> Vec<Prim> { 340 vec![ 341 bar([-0.45, -0.65], [-0.05, 0.65], BAR, AMBER), 342 bar([0.25, -0.65], [0.65, 0.65], BAR, AMBER), 343 ] 344} 345 346fn perpendicular() -> Vec<Prim> { 347 vec![ 348 bar([-0.35, -0.6], [-0.35, 0.65], BAR, AMBER), 349 bar([-0.45, -0.6], [0.7, -0.6], BAR, AMBER), 350 ] 351} 352 353fn tangent() -> Vec<Prim> { 354 vec![ 355 ring([-0.15, -0.12], 0.5, TUBE, STEEL), 356 bar([-0.85, 0.46], [0.7, 0.46], BAR, AMBER), 357 ] 358} 359 360fn equal() -> Vec<Prim> { 361 vec![ 362 bar([-0.55, 0.2], [0.55, 0.2], 0.1, AMBER), 363 bar([-0.55, -0.2], [0.55, -0.2], 0.1, AMBER), 364 ] 365} 366 367fn concentric() -> Vec<Prim> { 368 vec![ 369 ring([0.0, 0.0], 0.72, TUBE, STEEL), 370 ring([0.0, 0.0], 0.38, TUBE, AMBER), 371 dot([0.0, 0.0], DOT_SM, STEEL_LIGHT), 372 ] 373} 374 375fn midpoint() -> Vec<Prim> { 376 vec![ 377 bar([-0.75, -0.3], [0.75, 0.3], BAR, STEEL), 378 dot([0.0, 0.0], 0.2, AMBER), 379 ] 380} 381 382fn symmetric() -> Vec<Prim> { 383 vec![ 384 bar([0.0, -0.7], [0.0, 0.7], 0.05, STEEL_LIGHT), 385 dot([-0.5, 0.0], 0.2, AMBER), 386 dot([0.5, 0.0], 0.2, AMBER), 387 ] 388} 389 390fn fix() -> Vec<Prim> { 391 vec![ 392 bar([-0.7, -0.5], [0.7, -0.5], 0.07, DARK), 393 bar([-0.5, -0.5], [-0.7, -0.72], 0.05, DARK), 394 bar([-0.15, -0.5], [-0.35, -0.72], 0.05, DARK), 395 bar([0.2, -0.5], [0.0, -0.72], 0.05, DARK), 396 bar([0.55, -0.5], [0.35, -0.72], 0.05, DARK), 397 bar([0.0, -0.5], [0.0, 0.05], 0.06, STEEL_LIGHT), 398 dot([0.0, 0.28], 0.26, STEEL), 399 ] 400} 401 402fn extruded_boss_base() -> Vec<Prim> { 403 vec![ 404 Prim::cuboid([0.0, -0.5, 0.0], [0.78, 0.12, 0.55], mat(GRAY)), 405 Prim::cuboid([0.0, 0.02, 0.0], [0.4, 0.32, 0.4], mat(GREEN)), 406 Prim::arrow( 407 z0([0.0, 0.42]), 408 z0([0.0, 0.95]), 409 0.07, 410 0.2, 411 0.28, 412 mat(AMBER), 413 ), 414 ] 415} 416 417fn extruded_cut() -> Vec<Prim> { 418 vec![ 419 Prim::cuboid([0.0, -0.1, 0.0], [0.72, 0.5, 0.6], mat(GRAY)), 420 Prim::cuboid([0.0, 0.45, 0.0], [0.3, 0.22, 0.32], mat(RED)), 421 Prim::arrow(z0([0.0, 0.98]), z0([0.0, 0.42]), 0.07, 0.2, 0.28, mat(RED)), 422 ] 423} 424 425fn tree_feature() -> Vec<Prim> { 426 vec![Prim::cuboid( 427 [0.0, 0.0, 0.0], 428 [0.56, 0.56, 0.56], 429 mat(STEEL), 430 )] 431} 432 433fn tree_plane() -> Vec<Prim> { 434 vec![Prim::tilted_cuboid( 435 [0.0, 0.0, 0.0], 436 [0.72, 0.72, 0.035], 437 Rotation::about_x(turn(24.0)), 438 mat(AMBER_LIGHT), 439 )] 440} 441 442fn tree_sketch() -> Vec<Prim> { 443 vec![ 444 bar([-0.6, -0.4], [0.6, -0.4], BAR, STEEL), 445 ring([0.18, 0.28], 0.35, TUBE, AMBER), 446 ] 447} 448 449fn tree_origin() -> Vec<Prim> { 450 vec![ 451 Prim::bar([0.0, 0.0, 0.0], [0.85, 0.0, 0.0], 0.07, mat(AX_X)), 452 Prim::bar([0.0, 0.0, 0.0], [0.0, 0.85, 0.0], 0.07, mat(AX_Y)), 453 Prim::bar([0.0, 0.0, 0.0], [0.0, 0.0, 0.85], 0.07, mat(AX_Z)), 454 Prim::ball([0.0, 0.0, 0.0], 0.16, mat(DARK)), 455 ] 456} 457 458fn tab_tree() -> Vec<Prim> { 459 vec![ 460 dot([-0.55, 0.45], DOT_SM, AMBER), 461 dot([-0.55, 0.0], DOT_SM, AMBER), 462 dot([-0.55, -0.45], DOT_SM, AMBER), 463 bar([-0.3, 0.45], [0.6, 0.45], 0.07, STEEL), 464 bar([-0.3, 0.0], [0.6, 0.0], 0.07, STEEL), 465 bar([-0.3, -0.45], [0.6, -0.45], 0.07, STEEL), 466 ] 467} 468 469fn tab_properties() -> Vec<Prim> { 470 vec![ 471 Prim::cuboid([0.0, 0.0, 0.0], [0.52, 0.68, 0.05], mat(LIGHT)), 472 bar([-0.32, 0.38], [0.32, 0.38], 0.06, STEEL), 473 bar([-0.32, 0.08], [0.32, 0.08], 0.06, STEEL), 474 bar([-0.32, -0.22], [0.1, -0.22], 0.06, STEEL), 475 ] 476} 477 478fn tab_configuration() -> Vec<Prim> { 479 vec![ 480 Prim::cuboid([-0.2, -0.2, -0.12], [0.42, 0.42, 0.1], mat(STEEL_LIGHT)), 481 Prim::cuboid([0.18, 0.18, 0.12], [0.42, 0.42, 0.1], mat(STEEL)), 482 ] 483} 484 485fn tab_dimension_expert() -> Vec<Prim> { 486 vec![ 487 bar([-0.6, -0.55], [-0.6, 0.3], 0.05, STEEL_LIGHT), 488 bar([0.6, -0.55], [0.6, 0.3], 0.05, STEEL_LIGHT), 489 Prim::arrow( 490 z0([-0.05, -0.1]), 491 z0([-0.6, -0.1]), 492 0.05, 493 0.16, 494 0.22, 495 mat(AMBER), 496 ), 497 Prim::arrow( 498 z0([0.05, -0.1]), 499 z0([0.6, -0.1]), 500 0.05, 501 0.16, 502 0.22, 503 mat(AMBER), 504 ), 505 ] 506} 507 508fn tab_display() -> Vec<Prim> { 509 vec![ 510 Prim::ball([0.0, -0.05, 0.0], 0.6, mat(STEEL_LIGHT)), 511 Prim::ball([-0.22, 0.2, 0.4], 0.14, mat(LIGHT)), 512 ] 513} 514 515fn zoom_to_fit() -> Vec<Prim> { 516 vec![ 517 ring([-0.12, 0.16], 0.46, 0.1, STEEL), 518 bar([0.2, -0.16], [0.68, -0.64], 0.12, DARK), 519 bar([-0.7, 0.6], [-0.4, 0.6], 0.06, AMBER), 520 bar([-0.7, 0.6], [-0.7, 0.3], 0.06, AMBER), 521 bar([0.7, -0.6], [0.4, -0.6], 0.06, AMBER), 522 bar([0.7, -0.6], [0.7, -0.3], 0.06, AMBER), 523 ] 524} 525 526fn zoom_to_area() -> Vec<Prim> { 527 vec![ 528 ring([-0.18, 0.18], 0.42, 0.1, STEEL), 529 bar([0.14, -0.14], [0.62, -0.62], 0.12, DARK), 530 rect( 531 [[-0.45, -0.1], [0.35, -0.1], [0.35, 0.5], [-0.45, 0.5]], 532 0.05, 533 AMBER, 534 ), 535 ] 536} 537 538fn previous_view() -> Vec<Prim> { 539 vec![ 540 arc([0.0, -0.05], 0.62, 35.0, 250.0, 0.1, STEEL), 541 Prim::arrow( 542 z0([0.62, 0.18]), 543 z0([0.06, 0.5]), 544 0.05, 545 0.2, 546 0.26, 547 mat(AMBER), 548 ), 549 ] 550} 551 552fn section_view() -> Vec<Prim> { 553 vec![ 554 Prim::cuboid([0.0, 0.0, 0.0], [0.55, 0.55, 0.55], mat(STEEL)), 555 Prim::tilted_cuboid( 556 [0.0, 0.0, 0.0], 557 [0.66, 0.66, 0.025], 558 Rotation::about_y(turn(45.0)), 559 mat(AMBER_LIGHT), 560 ), 561 ] 562} 563 564fn view_orientation() -> Vec<Prim> { 565 vec![ 566 Prim::cuboid([0.0, 0.0, 0.0], [0.5, 0.5, 0.5], mat(STEEL_LIGHT)), 567 Prim::bar([-0.55, -0.55, -0.55], [0.1, -0.55, -0.55], 0.06, mat(AX_X)), 568 Prim::bar([-0.55, -0.55, -0.55], [-0.55, 0.1, -0.55], 0.06, mat(AX_Y)), 569 Prim::bar([-0.55, -0.55, -0.55], [-0.55, -0.55, 0.1], 0.06, mat(AX_Z)), 570 ] 571} 572 573fn display_style() -> Vec<Prim> { 574 vec![ 575 Prim::cuboid([0.0, -0.08, 0.0], [0.56, 0.48, 0.56], mat(STEEL)), 576 Prim::cuboid([0.0, 0.46, 0.0], [0.56, 0.06, 0.56], mat(LIGHT)), 577 ] 578} 579 580fn hide_show_items() -> Vec<Prim> { 581 vec![ 582 arc([0.0, -0.62], 0.92, 48.0, 84.0, 0.09, STEEL), 583 arc([0.0, 0.62], 0.92, 228.0, 84.0, 0.09, STEEL), 584 ring([0.0, 0.0], 0.32, 0.08, STEEL_LIGHT), 585 dot([0.0, 0.0], 0.18, DARK), 586 ] 587} 588 589fn edit_appearance() -> Vec<Prim> { 590 vec![ 591 Prim::ball([-0.1, -0.16, 0.24], 0.5, mat(AX_X)), 592 Prim::ball([-0.24, 0.18, -0.12], 0.46, mat(AX_Y)), 593 Prim::ball([0.2, -0.12, -0.22], 0.46, mat(AX_Z)), 594 bar([0.18, 0.16], [0.7, 0.68], 0.09, AMBER), 595 dot([0.16, 0.14], 0.16, DARK), 596 ] 597} 598 599fn view_settings() -> Vec<Prim> { 600 let teeth = (0..8u16).map(|k| { 601 let angle = f32::from(k) * 45.0; 602 let r = angle.to_radians(); 603 let center = [0.62 * r.cos(), 0.62 * r.sin(), 0.0]; 604 Prim::tilted_cuboid( 605 center, 606 [0.16, 0.12, 0.16], 607 Rotation::about_z(turn(angle)), 608 mat(STEEL), 609 ) 610 }); 611 core::iter::once(ring([0.0, 0.0], 0.52, 0.13, STEEL)) 612 .chain(teeth) 613 .chain(core::iter::once(dot([0.0, 0.0], 0.22, DARK))) 614 .collect() 615} 616 617fn check() -> Vec<Prim> { 618 vec![ 619 bar([-0.52, 0.04], [-0.08, -0.42], 0.1, WHITE), 620 bar([-0.08, -0.42], [0.56, 0.52], 0.1, WHITE), 621 ] 622} 623 624fn cross() -> Vec<Prim> { 625 vec![ 626 bar([-0.46, -0.46], [0.46, 0.46], 0.095, WHITE), 627 bar([-0.46, 0.46], [0.46, -0.46], 0.095, WHITE), 628 ] 629}