Renderers API
build123d_techdraw.renderers.svg
Vector SVG renderer with CSS custom variables and theme switching.
SVGRenderer
Renders DrawingSheet instances to interactive and print-ready SVG vector graphics.
Source code in src/build123d_techdraw/renderers/svg.py
render_sheet(sheet, theme=Theme.DARK_BLUEPRINT)
classmethod
save(sheet, output_path, theme=Theme.DARK_BLUEPRINT)
classmethod
Save rendered sheet to an SVG file.
Source code in src/build123d_techdraw/renderers/svg.py
build123d_techdraw.renderers.pdf
High-precision multi-page vector PDF export with native PDF 1.4 streaming and raster image support.
PDFRenderer
Renders vector technical drawings and embedded raster views to multi-page PDF documents.
Source code in src/build123d_techdraw/renderers/pdf.py
2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 | |
render_sheets_to_pdf(sheets_data, output_path, theme=Theme.DARK_BLUEPRINT, bookmarks=False, booklet_title='ENGINEERING DRAWINGS', sheet_titles=None)
classmethod
Render multiple sheets (tuples, DrawingSheets, or SVG paths/strings) to a multi-page PDF.
Source code in src/build123d_techdraw/renderers/pdf.py
build123d_techdraw.renderers.dxf
1:1 DXF flat pattern and multi-layer full drawing sheet export using ezdxf.
DXFRenderer
Exports 2D CAD views and complete drawing sheets to standard multi-layer DXF files.
Source code in src/build123d_techdraw/renderers/dxf.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 | |
export_shape_to_dxf(shape, output_path, dxfversion='R2010', plane=None, tolerance=0.05, strict=False)
classmethod
Export 2D cross-section, flat pattern, or 3D plate primary face to a 1:1 DXF file.
Source code in src/build123d_techdraw/renderers/dxf.py
export_sheet_to_dxf(sheet, output_path, dxfversion='R2010')
classmethod
Export the complete composed drawing sheet with standard CAD layers to DXF.
Source code in src/build123d_techdraw/renderers/dxf.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | |
export_flat_pattern_to_dxf(flat_pattern, output_path, *, include_bend_tangents=False, include_etch_labels=True, layers=None, dxfversion='R2010')
classmethod
Export a 1:1 CNC/laser-cutter DXF from a sheet metal FlatPattern.
Source code in src/build123d_techdraw/renderers/dxf.py
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 | |
build123d_techdraw.renderers.html
Interactive self-contained HTML5 blueprint renderer with live WebGL2 3D CAD viewport.
Combines a full dual-theme 2D DrawingSheet SVG with an embedded, zero-CDN WebGL2 3D
CAD inspector synchronized to the sheet's theme, assembly BOM, and camera conventions.
HTMLRenderer
Renders DrawingSheet instances to self-contained interactive 3D-in-2D HTML5 blueprints.
Source code in src/build123d_techdraw/renderers/html.py
512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 | |
serialize_sheet_scene(sheet, theme=Theme.DARK_BLUEPRINT, *, shape=None, linear_deflection=0.08, angular_deflection=0.25, crease_angle_deg=20.0)
classmethod
Tessellate and serialize the sheet's 3D model, parts, BOM, and theme metadata.
Source code in src/build123d_techdraw/renderers/html.py
515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 | |
render_sheet(sheet, theme=Theme.DARK_BLUEPRINT, *, shape=None, linear_deflection=0.08, angular_deflection=0.25, crease_angle_deg=20.0, title=None, initial_layout='split')
classmethod
Render a complete, self-contained HTML5 document string with 2D SVG + 3D WebGL2.
Source code in src/build123d_techdraw/renderers/html.py
save(sheet, output_path, theme=Theme.DARK_BLUEPRINT, *, shape=None, linear_deflection=0.08, angular_deflection=0.25, crease_angle_deg=20.0, title=None, initial_layout='split')
classmethod
Render and write a self-contained interactive 3D-in-2D HTML blueprint file.
Source code in src/build123d_techdraw/renderers/html.py
render_interactive_html(sheet, theme=Theme.DARK_BLUEPRINT, *, shape=None, linear_deflection=0.08, angular_deflection=0.25, crease_angle_deg=20.0, title=None, initial_layout='split')
Render a DrawingSheet to a self-contained interactive HTML5 document string.
Source code in src/build123d_techdraw/renderers/html.py
export_interactive_html(sheet, output_path, theme=Theme.DARK_BLUEPRINT, *, shape=None, linear_deflection=0.08, angular_deflection=0.25, crease_angle_deg=20.0, title=None, initial_layout='split')
Export a DrawingSheet to a self-contained interactive HTML5 blueprint file.
Source code in src/build123d_techdraw/renderers/html.py
build123d_techdraw.renderers.theme
Theme definitions and CSS custom property palettes for 2D technical drawings.