From 8d22940506df525ac52ef6f8a00ea03661f3b682 Mon Sep 17 00:00:00 2001 From: Chris Palmer Date: Mon, 28 Dec 2020 20:49:37 +0000 Subject: [PATCH] Project blurb can now be split with into sections with markdown horizonal rules made with asterisks. If an image is include in the first section the default image is supressed. --- readme.md | 123 ----------------------------------------------- scripts/blurb.py | 12 ++++- scripts/views.py | 18 ++++++- 3 files changed, 26 insertions(+), 127 deletions(-) diff --git a/readme.md b/readme.md index b0376bf..c6fa3a2 100644 --- a/readme.md +++ b/readme.md @@ -16,7 +16,6 @@ See [usage](docs/usage.md) for requirements, installation instructions and a usa - ## Table of Contents @@ -52,7 +51,6 @@ See [usage](docs/usage.md) for requirements, installation instructions and a usa ## Axials Axial components for PCBs. - [vitamins/axials.scad](vitamins/axials.scad) Object definitions. [vitamins/axial.scad](vitamins/axial.scad) Implementation. @@ -103,7 +101,6 @@ If a ball bearing has a child it is placed on its top surface, the same as nuts Also single bearing balls are modelled as just a silver sphere and a BOM entry. - [vitamins/ball_bearings.scad](vitamins/ball_bearings.scad) Object definitions. [vitamins/ball_bearing.scad](vitamins/ball_bearing.scad) Implementation. @@ -153,7 +150,6 @@ Note that the [Lumintop LM34](http://www.lumintop.com/lm34c-usb-rechargeable-186 The battery length includes its contacts and the origin is the centre of that length. As well as drawing the battery and contacts there are functions exposing enough information to make a battery box. - [vitamins/batteries.scad](vitamins/batteries.scad) Object definitions. [vitamins/battery.scad](vitamins/battery.scad) Implementation. @@ -217,7 +213,6 @@ To draw the gap its XY position is specified by `gap_pos`. `gap_pos.z` can be us Individual teeth are not drawn, instead they are represented by a lighter colour. - [vitamins/belts.scad](vitamins/belts.scad) Object definitions. [vitamins/belt.scad](vitamins/belt.scad) Implementation. @@ -270,7 +265,6 @@ Individual teeth are not drawn, instead they are represented by a lighter colour ## Blowers Models of radial blowers. - [vitamins/blowers.scad](vitamins/blowers.scad) Object definitions. [vitamins/blower.scad](vitamins/blower.scad) Implementation. @@ -334,7 +328,6 @@ Crude representation of a bulldog clip. The handle is not currently drawn but it accessed to allow clearance. Used for holding glass on 3D printer beds but Swiss picture clips can be better. - [vitamins/bulldogs.scad](vitamins/bulldogs.scad) Object definitions. [vitamins/bulldog.scad](vitamins/bulldog.scad) Implementation. @@ -373,7 +366,6 @@ better. ## Buttons PCB mounted buttons. Can optionally have a coloured cap - [vitamins/buttons.scad](vitamins/buttons.scad) Object definitions. [vitamins/button.scad](vitamins/button.scad) Implementation. @@ -422,7 +414,6 @@ near the extreme positions, where the model needs to be accurate. When the sides are constrained then a circular model is more accurate. - [vitamins/cable_strip.scad](vitamins/cable_strip.scad) Implementation. [tests/cable_strips.scad](tests/cable_strips.scad) Code for this example. @@ -455,7 +446,6 @@ When the sides are constrained then a circular model is more accurate. ## Cameras PCB cameras. - [vitamins/cameras.scad](vitamins/cameras.scad) Object definitions. [vitamins/camera.scad](vitamins/camera.scad) Implementation. @@ -494,7 +484,6 @@ PCB cameras. ## Circlips Circlips aka tapered retaining rings. - [vitamins/circlips.scad](vitamins/circlips.scad) Object definitions. [vitamins/circlip.scad](vitamins/circlip.scad) Implementation. @@ -536,7 +525,6 @@ Circlips aka tapered retaining rings. ## Components Various electronic components used in hot ends and heated beds. - [vitamins/components.scad](vitamins/components.scad) Object definitions. [vitamins/component.scad](vitamins/component.scad) Implementation. @@ -631,7 +619,6 @@ Various electronic components used in hot ends and heated beds. ## D_connectors D-connectors. Can be any number of ways, male or female, solder buckets, PCB mount or IDC, with or without pillars. - [vitamins/d_connectors.scad](vitamins/d_connectors.scad) Object definitions. [vitamins/d_connector.scad](vitamins/d_connector.scad) Implementation. @@ -687,7 +674,6 @@ D-connectors. Can be any number of ways, male or female, solder buckets, PCB mou ## DIP Dual inline IC packages and sockets - [vitamins/dip.scad](vitamins/dip.scad) Implementation. [tests/DIP.scad](tests/DIP.scad) Code for this example. @@ -731,7 +717,6 @@ Dual inline IC packages and sockets ## Displays LCD dispays. - [vitamins/displays.scad](vitamins/displays.scad) Object definitions. [vitamins/display.scad](vitamins/display.scad) Implementation. @@ -782,7 +767,6 @@ LCD dispays. ## Extrusion_brackets Brackets for joining extrusions at a corner. - [vitamins/extrusion_brackets.scad](vitamins/extrusion_brackets.scad) Object definitions. [vitamins/extrusion_bracket.scad](vitamins/extrusion_bracket.scad) Implementation. @@ -830,7 +814,6 @@ Brackets for joining extrusions at a corner. ## Extrusions Aluminium extrusion. - [vitamins/extrusions.scad](vitamins/extrusions.scad) Object definitions. [vitamins/extrusion.scad](vitamins/extrusion.scad) Implementation. @@ -881,7 +864,6 @@ Axial fans. Can draw three styles: solid, open frame and open frame with screw bosses. - [vitamins/fans.scad](vitamins/fans.scad) Object definitions. [vitamins/fan.scad](vitamins/fan.scad) Implementation. @@ -950,7 +932,6 @@ Can draw three styles: solid, open frame and open frame with screw bosses. ## Fuseholder 20mm panel mount fuse holder. - [vitamins/fuseholder.scad](vitamins/fuseholder.scad) Implementation. [tests/fuseholder.scad](tests/fuseholder.scad) Code for this example. @@ -981,7 +962,6 @@ Can draw three styles: solid, open frame and open frame with screw bosses. ## Geared_steppers Geared tin can steppers - [vitamins/geared_steppers.scad](vitamins/geared_steppers.scad) Object definitions. [vitamins/geared_stepper.scad](vitamins/geared_stepper.scad) Implementation. @@ -1032,7 +1012,6 @@ Geared tin can steppers ## Green_terminals Parametric green terminal blocks - [vitamins/green_terminals.scad](vitamins/green_terminals.scad) Object definitions. [vitamins/green_terminal.scad](vitamins/green_terminal.scad) Implementation. @@ -1084,7 +1063,6 @@ Hot end models. The E3D models were originally contributed to Mendel90 by Philip Needs updating as mostly obsolete versions. - [vitamins/hot_ends.scad](vitamins/hot_ends.scad) Object definitions. [vitamins/hot_end.scad](vitamins/hot_end.scad) Implementation. @@ -1146,7 +1124,6 @@ Needs updating as mostly obsolete versions. ## Hygrometer Mini LCD Celsius Digital Thermometer Hygrometer Temperature Humidity Meter Gauge on eBay - [vitamins/hygrometer.scad](vitamins/hygrometer.scad) Implementation. [tests/hygrometer.scad](tests/hygrometer.scad) Code for this example. @@ -1177,7 +1154,6 @@ Mini LCD Celsius Digital Thermometer Hygrometer Temperature Humidity Meter Gauge ## IECs IEC mains inlets and outlet. - [vitamins/iecs.scad](vitamins/iecs.scad) Object definitions. [vitamins/iec.scad](vitamins/iec.scad) Implementation. @@ -1245,7 +1221,6 @@ IEC mains inlets and outlet. ## Inserts Heatfit threaded inserts. Can be pushed into thermoplastics using a soldering iron with a conical bit set to 200°C. - [vitamins/inserts.scad](vitamins/inserts.scad) Object definitions. [vitamins/insert.scad](vitamins/insert.scad) Implementation. @@ -1297,7 +1272,6 @@ Heatfit threaded inserts. Can be pushed into thermoplastics using a soldering ir 4mm jack sockets and binding posts. Each has a colour for the BOM entry and an optional alternative colour for display. E.g. a "brown" socket for mains live needs to be displayed as "sienna" to look realistic. - [vitamins/jack.scad](vitamins/jack.scad) Implementation. [tests/jack.scad](tests/jack.scad) Code for this example. @@ -1334,7 +1308,6 @@ E.g. a "brown" socket for mains live needs to be displayed as "sienna" to look r ## KP_pillow_blocks KP pillow block bearings - [vitamins/kp_pillow_blocks.scad](vitamins/kp_pillow_blocks.scad) Object definitions. [vitamins/kp_pillow_block.scad](vitamins/kp_pillow_block.scad) Implementation. @@ -1389,7 +1362,6 @@ Light dependent resistors. Larger ones seem to have both a higher dark resistance and a lower bright light resistance. - [vitamins/ldrs.scad](vitamins/ldrs.scad) Object definitions. [vitamins/ldr.scad](vitamins/ldr.scad) Implementation. @@ -1428,7 +1400,6 @@ Larger ones seem to have both a higher dark resistance and a lower bright light ## Leadnuts Nuts for leadscrews. - [vitamins/leadnuts.scad](vitamins/leadnuts.scad) Object definitions. [vitamins/leadnut.scad](vitamins/leadnut.scad) Implementation. @@ -1482,7 +1453,6 @@ bezel is fixed in the panel with hot glue. The 7 SEGMENT.TTF font from the [docs](docs) directory needs to be installed to get realistic digits. - [vitamins/led_meters.scad](vitamins/led_meters.scad) Object definitions. [vitamins/led_meter.scad](vitamins/led_meter.scad) Implementation. @@ -1541,7 +1511,6 @@ The 7 SEGMENT.TTF font from the [docs](docs) directory needs to be installed to ## LEDs Standard domed through hole LEDs. Can specify colour and lead length. - [vitamins/leds.scad](vitamins/leds.scad) Object definitions. [vitamins/led.scad](vitamins/led.scad) Implementation. @@ -1590,7 +1559,6 @@ which can by calcuated using `light_strip_segments(type, max_length)`. The `light_strip_clip()` module makes a clip to go around the light that can be incorporated into a printed bracket to hold it. - [vitamins/light_strips.scad](vitamins/light_strips.scad) Object definitions. [vitamins/light_strip.scad](vitamins/light_strip.scad) Implementation. @@ -1642,7 +1610,6 @@ The `light_strip_clip()` module makes a clip to go around the light that can be ## Linear_bearings LMnUU linear bearings. - [vitamins/linear_bearings.scad](vitamins/linear_bearings.scad) Object definitions. [vitamins/linear_bearing.scad](vitamins/linear_bearing.scad) Implementation. @@ -1699,7 +1666,6 @@ LMnUU linear bearings. ## Magnets Cylindrical and ring magnets. - [vitamins/magnets.scad](vitamins/magnets.scad) Object definitions. [vitamins/magnet.scad](vitamins/magnet.scad) Implementation. @@ -1729,7 +1695,6 @@ Cylindrical and ring magnets. ## Mains_sockets UK 13A sockets at the moment. - [vitamins/mains_sockets.scad](vitamins/mains_sockets.scad) Object definitions. [vitamins/mains_socket.scad](vitamins/mains_socket.scad) Implementation. @@ -1778,7 +1743,6 @@ UK 13A sockets at the moment. ## Microswitches Used for limit switches. - [vitamins/microswitches.scad](vitamins/microswitches.scad) Object definitions. [vitamins/microswitch.scad](vitamins/microswitch.scad) Implementation. @@ -1836,7 +1800,6 @@ Microview OLED display with on board AVR by geekammo / Sparkfun. Uses STL files copyright geekammo and licenced with MIT license, see [microview/LICENSE.txt](vitamins/microview/LICENSE.txt). - [vitamins/microview.scad](vitamins/microview.scad) Implementation. [tests/microview.scad](tests/microview.scad) Code for this example. @@ -1861,7 +1824,6 @@ Uses STL files copyright geekammo and licenced with MIT license, see [microview/ ## Modules Random screw down modules. Currently just DROK buck converters. - [vitamins/modules.scad](vitamins/modules.scad) Object definitions. [vitamins/module.scad](vitamins/module.scad) Implementation. @@ -1907,7 +1869,6 @@ Default is steel but can be drawn as brass or nylon. A utility for making nut tr If a nut is given a child then it gets placed on its top surface. - [vitamins/nuts.scad](vitamins/nuts.scad) Object definitions. [vitamins/nut.scad](vitamins/nut.scad) Implementation. @@ -1989,7 +1950,6 @@ Nitrile rubber O-rings. Just a black torus specified by internal diameter, `id` and `minor_d` plus a BOM entry. Can be shown stretched by specifying the `actual_id`. - [vitamins/o_ring.scad](vitamins/o_ring.scad) Implementation. [tests/o_ring.scad](tests/o_ring.scad) Code for this example. @@ -2016,7 +1976,6 @@ Nicodrone OpenGrab V3 electro-permananet magnet, see . - [vitamins/screws.scad](vitamins/screws.scad) Object definitions. [vitamins/screw.scad](vitamins/screw.scad) Implementation. @@ -2997,7 +2944,6 @@ For an explanation of `screw_polysink()` see . - [printed/carriers.scad](printed/carriers.scad) Implementation. [tests/carriers.scad](tests/carriers.scad) Code for this example. @@ -4416,7 +4338,6 @@ This allows the block and one set of fasteners to be on one assembly and the oth Star washers can be omitted by setting `star_washers` to false. - [printed/corner_block.scad](printed/corner_block.scad) Implementation. [tests/corner_block.scad](tests/corner_block.scad) Code for this example. @@ -4490,7 +4411,6 @@ Door hinges to hang an acrylic sheet door on a 3D printer, default 6mm thick. The screws are tapped into the acrylic. Rubber door [sealing strip](#sealing_strip) is used to make it airtight and a [door_latch](#door_latch) holds it closed. - [printed/door_hinge.scad](printed/door_hinge.scad) Implementation. [tests/door_hinge.scad](tests/door_hinge.scad) Code for this example. @@ -4543,7 +4463,6 @@ Rubber door [sealing strip](#sealing_strip) is used to make it airtight and a [d ## Door_latch Door latch for 6mm acrylic door for 3D printer. See [door_hinge](#door_hinge). - [printed/door_latch.scad](printed/door_latch.scad) Implementation. [tests/door_latch.scad](tests/door_latch.scad) Code for this example. @@ -4592,7 +4511,6 @@ If both ends are customised then two children are expected. Each child is called twice, once with `$fasteners` set to 0 to augment the STL and again with `$fasteners` set to 1 to add to the assembly, for example to add inserts. - [printed/drag_chain.scad](printed/drag_chain.scad) Implementation. [tests/drag_chain.scad](tests/drag_chain.scad) Code for this example. @@ -4651,7 +4569,6 @@ Pintable fan finger guard to match the specified fan. To be `include`d, not `use The ring spacing as well as the number of spokes can be specified, if zero a gasket is generated instead of a guard. - [printed/fan_guard.scad](printed/fan_guard.scad) Implementation. [tests/fan_guard.scad](tests/fan_guard.scad) Code for this example. @@ -4701,7 +4618,6 @@ This allows the block and one set of fasteners to be on one assembly and the oth Star washers can be omitted by setting `star_washers` to false. - [printed/fixing_block.scad](printed/fixing_block.scad) Implementation. [tests/fixing_block.scad](tests/fixing_block.scad) Code for this example. @@ -4783,7 +4699,6 @@ Note setting `thickness1` or `thickness2` to zero in the `hinge_fastened_assembl setting `show_hinge` to false removes the hinge. This allows the hinges and one set of screws to belong to one assembly and the other set of screws to another assembly. - [printed/flat_hinge.scad](printed/flat_hinge.scad) Implementation. [tests/flat_hinge.scad](tests/flat_hinge.scad) Code for this example. @@ -4850,7 +4765,6 @@ This allows the hinges and one set of screws to belong to one assembly and the o Customisable printed rubber feet for equipment cases. The insert variant is better for solid feet because inserts don't grip well in rubber. - [printed/foot.scad](printed/foot.scad) Implementation. [tests/foot.scad](tests/foot.scad) Code for this example. @@ -4912,7 +4826,6 @@ inserts don't grip well in rubber. ## Handle Printed handle that can be printed without needing support material due to its truncated teardrop profile. - [printed/handle.scad](printed/handle.scad) Implementation. [tests/handle.scad](tests/handle.scad) Code for this example. @@ -4963,7 +4876,6 @@ Printed handle that can be printed without needing support material due to its t A frame to mount a PCB by its corners when it has no mounting holes. The stl must be given a parameterless wrapper in the project that uses it. - [printed/pcb_mount.scad](printed/pcb_mount.scad) Implementation. [tests/PCB_mount.scad](tests/PCB_mount.scad) Code for this example. @@ -5012,7 +4924,6 @@ Utility for making printed press fit connectors to join printed parts. Add solvent or glue to make a permanent fixture. - [printed/press_fit.scad](printed/press_fit.scad) Implementation. [tests/press_fit.scad](tests/press_fit.scad) Code for this example. @@ -5039,7 +4950,6 @@ See the mounting points for the feet in the first example. It can also have printed feet on the base with the screws doubling up to hold the base on. - [printed/printed_box.scad](printed/printed_box.scad) Implementation. [tests/printed_box.scad](tests/printed_box.scad) Code for this example. @@ -5118,7 +5028,6 @@ It can also have printed feet on the base with the screws doubling up to hold th A cover to go over the mains end of a PSU terminal strip to make it safe. The stl and assembly must be given a name and parameterless wrappers for the stl and assembly added to the project. - [printed/psu_shroud.scad](printed/psu_shroud.scad) Implementation. [tests/PSU_shroud.scad](tests/PSU_shroud.scad) Code for this example. @@ -5177,7 +5086,6 @@ The stl and assembly must be given a name and parameterless wrappers for the stl ## Ribbon_clamp Clamp for ribbon cable and polypropylene strip. - [printed/ribbon_clamp.scad](printed/ribbon_clamp.scad) Implementation. [tests/ribbon_clamp.scad](tests/ribbon_clamp.scad) Code for this example. @@ -5236,7 +5144,6 @@ Clamp for ribbon cable and polypropylene strip. ## Screw_knob Knob with embedded hex head screw. - [printed/screw_knob.scad](printed/screw_knob.scad) Implementation. [tests/screw_knob.scad](tests/screw_knob.scad) Code for this example. @@ -5275,7 +5182,6 @@ Knob with embedded hex head screw. ## Socket_box UK 13A socket and printed backbox with earth terminal for the panel it is mounted on. - [printed/socket_box.scad](printed/socket_box.scad) Implementation. [tests/socket_box.scad](tests/socket_box.scad) Code for this example. @@ -5327,7 +5233,6 @@ UK 13A socket and printed backbox with earth terminal for the panel it is mounte A cover to go over the mains end of an SSR to make it safe to be touched. The STL and assembly must be given a name and parameterless wrappers for the stl and assembly added to the project. - [printed/ssr_shroud.scad](printed/ssr_shroud.scad) Implementation. [tests/SSR_shroud.scad](tests/SSR_shroud.scad) Code for this example. @@ -5382,7 +5287,6 @@ The STL and assembly must be given a name and parameterless wrappers for the stl Retracting strap handle. Print the strap with flexible filament. Shown with default dimensions but can be fully customised by passing a list of properties. - [printed/strap_handle.scad](printed/strap_handle.scad) Implementation. [tests/strap_handle.scad](tests/strap_handle.scad) Code for this example. @@ -5442,7 +5346,6 @@ be fully customised by passing a list of properties. ## Annotation Annotation used in this documentation - [utils/annotation.scad](utils/annotation.scad) Implementation. [tests/annotation.scad](tests/annotation.scad) Code for this example. @@ -5463,7 +5366,6 @@ Annotation used in this documentation ## Bezier Bezier curves and function to get and adjust the length or minimum z point. - [utils/bezier.scad](utils/bezier.scad) Implementation. [tests/bezier.scad](tests/bezier.scad) Code for this example. @@ -5494,7 +5396,6 @@ length of the cable and the end point coordinates. See - [utils/hanging_hole.scad](utils/hanging_hole.scad) Implementation. [tests/hanging_hole.scad](tests/hanging_hole.scad) Code for this example. @@ -5631,7 +5528,6 @@ Utilities for depicting the staircase slicing of horizontal holes made with [`te `horicylinder()` makes cylinders that fit inside a round hole. Layers that are less than 2 filaments wide and layers that need more than a 45 degree overhang are omitted. - [utils/horiholes.scad](utils/horiholes.scad) Implementation. [tests/horiholes.scad](tests/horiholes.scad) Code for this example. @@ -5658,7 +5554,6 @@ Utilities for depicting the staircase slicing of horizontal holes made with [`te ## Layout Layout objects in a line with equal gaps given a vector of their widths. - [utils/layout.scad](utils/layout.scad) Implementation. [tests/layout.scad](tests/layout.scad) Code for this example. @@ -5683,7 +5578,6 @@ Layout objects in a line with equal gaps given a vector of their widths. ## Maths Maths utilities for manipulating vectors and matrices. - [utils/maths.scad](utils/maths.scad) Implementation. [tests/maths.scad](tests/maths.scad) Code for this example. @@ -5744,7 +5638,6 @@ Can be used to round corners. Positive offsets will round convex corners, negati If `chamfer_base` is true then the bottom edge is made suitable for 3D printing by chamfering when the angle gets shallower than 45 degrees. - [utils/offset.scad](utils/offset.scad) Implementation. [tests/offset.scad](tests/offset.scad) Code for this example. @@ -5764,7 +5657,6 @@ If `chamfer_base` is true then the bottom edge is made suitable for 3D printing ## Quadrant Square with one rounded corner. - [utils/quadrant.scad](utils/quadrant.scad) Implementation. [tests/quadrant.scad](tests/quadrant.scad) Code for this example. @@ -5788,7 +5680,6 @@ A single radius can be specified or separate internal and external radii. If `chamfer_base` is `true` for `round_3D()` then the bottom edge is made suitable for 3D printing by chamfering once the the angle gets shallower than 45 degrees. - [utils/round.scad](utils/round.scad) Implementation. [tests/round.scad](tests/round.scad) Code for this example. @@ -5809,7 +5700,6 @@ the angle gets shallower than 45 degrees. ## Rounded_cylinder Cylinder with a rounded end. - [utils/rounded_cylinder.scad](utils/rounded_cylinder.scad) Implementation. [tests/rounded_cylinder.scad](tests/rounded_cylinder.scad) Code for this example. @@ -5832,7 +5722,6 @@ Draw a polygon with rounded corners. Each element of the vector is the XY coordi Because the tangents need to be calculated to find the length these can be calculated separately and re-used when drawing to save calculating them twice. - [utils/rounded_polygon.scad](utils/rounded_polygon.scad) Implementation. [tests/rounded_polygon.scad](tests/rounded_polygon.scad) Code for this example. @@ -5858,7 +5747,6 @@ Because the tangents need to be calculated to find the length these can be calcu ## Rounded_right_triangle Draw a 3D right triangle with rounded edges. Intended to be embedded in other parts. Can be optionally offset by the filleted amount. - [utils/rounded_right_triangle.scad](utils/rounded_right_triangle.scad) Implementation. [tests/rounded_right_triangle.scad](tests/rounded_right_triangle.scad) Code for this example. @@ -5878,7 +5766,6 @@ Draw a 3D right triangle with rounded edges. Intended to be embedded in other pa ## Sector A sector of a circle between two angles. - [utils/sector.scad](utils/sector.scad) Implementation. [tests/sector.scad](tests/sector.scad) Code for this example. @@ -5904,7 +5791,6 @@ Subsequent rotations use the minimum rotation method. The path can be open or closed. If closed sweep ensures that the start and end have the same rotation to line up. An additional twist around the path can be specified. If the path is closed this should be a multiple of 360. - [utils/sweep.scad](utils/sweep.scad) Implementation. [tests/sweep.scad](tests/sweep.scad) Code for this example. @@ -5956,7 +5842,6 @@ The same variable also affects the generation of assembly diagrams. Threads obey the $fn, $fa, $fs variables. - [utils/thread.scad](utils/thread.scad) Implementation. [tests/thread.scad](tests/thread.scad) Code for this example. @@ -5984,7 +5869,6 @@ Threads obey the $fn, $fa, $fs variables. ## Tube Simple tube or ring - [utils/tube.scad](utils/tube.scad) Implementation. [tests/tube.scad](tests/tube.scad) Code for this example. @@ -6014,7 +5898,6 @@ This heuristic isn't always correct, so the default can be overridden by setting The example below shows how to define a vitamin and incorporate it into an assembly with sub-assemblies and make an exploded view. The resulting flat BOM is shown but heirachical BOMs are also generated for real projects. - [utils/core/bom.scad](utils/core/bom.scad) Implementation. [tests/BOM.scad](tests/BOM.scad) Code for this example. @@ -6084,7 +5967,6 @@ Construct arbirarily large box to partition 3D space and clip objects, useful fo Original version by Doug Moen on the OpenSCAD forum - [utils/core/clip.scad](utils/core/clip.scad) Implementation. [tests/clip.scad](tests/clip.scad) Code for this example. @@ -6105,7 +5987,6 @@ Original version by Doug Moen on the OpenSCAD forum ## Global Global constants, functions and modules. This file is used directly or indirectly in every scad file. - [utils/core/global.scad](utils/core/global.scad) Implementation. [tests/global.scad](tests/global.scad) Code for this example. @@ -6165,7 +6046,6 @@ veiwed end on. When `twist` is set the resulting cylinder is extended by `eps` at each end so that the exact length of the hole can be used without leaving a scar on either surface. - [utils/core/polyholes.scad](utils/core/polyholes.scad) Implementation. [tests/polyholes.scad](tests/polyholes.scad) Code for this example. @@ -6229,7 +6109,6 @@ leaving a scar on either surface. ## Rounded_rectangle Rectangle with rounded corners. - [utils/core/rounded_rectangle.scad](utils/core/rounded_rectangle.scad) Implementation. [tests/rounded_rectangle.scad](tests/rounded_rectangle.scad) Code for this example. @@ -6253,7 +6132,6 @@ Rectangle with rounded corners. Redefines `sphere()` to always have a vertex on all six half axes I.e. vertices at the poles and the equator and `$fn` a multiple of four. This ensures `hull` and `minkowski` results have the correct dimensions when spheres are placed at the corners. - [utils/core/sphere.scad](utils/core/sphere.scad) Implementation. [tests/sphere.scad](tests/sphere.scad) Code for this example. @@ -6277,7 +6155,6 @@ Small holes can get away without it, but they print better with truncated teardr Using teardrop_plus() or setting the plus option on other modules will elongate the teardrop vertically by the layer height, so when sliced the staircase tips do not intrude into the circle. See - [utils/core/teardrops.scad](utils/core/teardrops.scad) Implementation. [tests/teardrops.scad](tests/teardrops.scad) Code for this example. diff --git a/scripts/blurb.py b/scripts/blurb.py index 99ed66d..0ca7ddd 100644 --- a/scripts/blurb.py +++ b/scripts/blurb.py @@ -39,8 +39,6 @@ def _scrape_blurb(lines): if b: break text += t - if len(text): - text += '\n' return text def scrape_blurb(scad_file): @@ -49,6 +47,16 @@ def scrape_blurb(scad_file): lines = file.readlines() return _scrape_blurb(lines) +def split_blurb(lines): + """ Split blurb on horizontal rules.""" + blurbs = [""] + for line in lines.split('\n')[:-1]: + if line == "***": + blurbs.append("") + else: + blurbs[-1] += line + '\n' + return blurbs + def scrape_module_blurb(lines): """ Find the Markup lines before the last function or module. """ text = "" diff --git a/scripts/views.py b/scripts/views.py index 954e225..7391296 100755 --- a/scripts/views.py +++ b/scripts/views.py @@ -35,6 +35,7 @@ import json import blurb import bom import shutil +import re from colorama import Fore def is_assembly(s): @@ -217,12 +218,21 @@ def views(target, do_assemblies = None): if not main_file: raise Exception("can't find source for main_assembly") text = blurb.scrape_blurb(source_dir + '/' + main_file) + blurbs = blurb.split_blurb(text) if len(text): - print(text, file = doc_file, end = '') + print(blurbs[0], file = doc_file) else: if print_mode: print(Fore.MAGENTA + "Missing project description" + Fore.WHITE) - print('![Main Assembly](assemblies/%s.png)\n' % flat_bom[-1]["name"].replace('_assembly', '_assembled'), file = doc_file) + # + # Only add the image if the first blurb section doesn't contain one. + # + got_image = False + for line in blurbs[0].split('\n'): + if re.match(r'.*\!\[.*\]\(.*\).*', line): + got_image = True + if not got_image: + print('![Main Assembly](assemblies/%s.png)\n' % flat_bom[-1]["name"].replace('_assembly', '_assembled'), file = doc_file) eop(print_mode, doc_file, first = True) # # Build TOC @@ -234,6 +244,8 @@ def views(target, do_assemblies = None): cap_name = titalise(name) print('1. [%s](#%s)' % (cap_name, name), file = doc_file) print(file = doc_file) + if len(blurbs) > 1: + print(blurbs[1], file = doc_file) eop(print_mode, doc_file) # # Global BOM @@ -283,6 +295,8 @@ def views(target, do_assemblies = None): print("| %s | %s |" % (pad(grand_total, 2, 1), pad('Total %s count' % headings[t], 2)), file = doc_file) print(file = doc_file) + if len(blurbs) > 2: + print(blurbs[2], file = doc_file) eop(print_mode, doc_file) # # Assembly instructions
Vitamins A-I Vitamins J-Q Vitamins R-Z Printed Utilities Core Utilities