#!/usr/bin/python3 '''Generate goofy composite material processing ideas. Sometimes puts extra spaces inside paragraphs or chooses the same ingredient twice. Output isn't vaild Markdown. ''' import random, textwrap adhesives = ''' - PVA glue; - epoxy resin and similar resin systems, if they don't attack the balloons; - cyanoacrylate adhesive; - plaster of Paris (thank you, Javier Candeira!); - sodium silicate waterglass; - slaked lime, if it doesn't attack the balloons or fibers; - portland cement, if it doesn't attack the balloons or fibers and the color isn't a problem; - calcium aluminate cement, if it doesn't attack the balloons or fibers, and refractoriness is desired; - Sorel cement, if it doesn't attack the balloons or fibers, and maximal strength is desired; - a so-called "geopolymer cement"; - latex paint; - shellac; - polyurethanes; - urea-formaldehyde resin; - phenolic resin; - various kinds of solvent-based plastic cements such as PVC dissolved in acetone, if the solvent doesn't attack the balloons or fibers; - clay, whether simply allowed to dry or later fired; - tar, though probably using a solvent rather than heat; - paraffin or other waxes, if the balloons can handle their melting temperatures; - spray foam; ''' fibers = ''' - nothing; - heavily perforated paper; - paper towels; - cotton cloth, whether light like cotton tulle or heavy like canvas, and whether with a narrow weave like twill to maximize the strength of the fabric or a loose weave to ensure good adhesion between the adhesive on both sides of the fiber; - burlap (aka Hessian), especially sisal or jute, to minimize cost and ensure good adhesion between the adhesive on both sides of the fiber; - gauze, as in traditional plaster casts for broken bones (thank you, Javier Candeira!); - mosquito netting; - fiberglass cloth, as in traditional glass-reinforced polymer layups or in printed circuit boards, although if the binder is strongly basic you might need to use alkali-resistant fiberglass; - carbon fiber; - ceramic fiber like those used in refractory blankets and flocking, if resistance to high temperatures is desired (typically these fibers are mixes of mullite, alumina, zirconia, and silica); - basalt fiber; - steel window screens; - aluminum or fiberglass window screens, if the binder is not strongly basic; - stainless steel cloth; - thicker and stronger metal reinforcement such as traditional rebar tie-ups, hardware cloth, chicken wire, or expanded sheet metal; - copper wires; - gel-spun ultra-high-molecular-weight polyethylene fibers; ''' additives = ''' - pigments; - quartz sand for extra strength; - olivine or zircon sand for extra strength at higher temperatures; - clay, such as bentonite, functionalized if necessary to bond well with the adhesive, in order to increase strength or decrease oxygen permeability; - other soils, such as silt, as the lowest-cost fillers available; - encapsulated air bubbles to reduce density, such as hollow microspheres of steel, glass, or plastic; - vermiculite, perlite, pumice, or similar foamed minerals to reduce density; - polystyrene foam beads or similar foamed plastic beads to reduce density; - lead, bismuth, or steel particles to increase density; - rubber particles to increase shock damping and reduce rigidity; - graphite, amorphous carbon, or silicon carbide to increase electrical conductivity and/or heat resistance; - donors of alkali metals and boron to reduce melting point and increase the thermal coefficient of expansion, for example to facilitate fire-glazing the surface afterwards — carbonates of sodium and potassium, boric acid, and borax are traditional here; - foaming agents like baking powder; - plasticizers like phthalate esters; - chopped fibers, for example of basalt fiber or any of the other types mentioned earlier, or other fibers such as hair clippings, horsehair, paper fibers as in ordinary papier-mâché, sawdust or other wood fibers, grass clippings, used yerba mate, bamboo fibers, or straw; - broken glass, for example for decorative purposes; - abrasives, such as aluminum oxide or silicon carbide; - pesticides such as copper chloride or blue vitriol to prevent biodegradation, for example by insects eating wheat paste and cotton fibers; - UV blockers such as titanium dioxide to prevent photodegradation; - additives to increase effective heat capacity, such as microencapsulated phase-change materials; - milled mica, stainless steel, aluminum powder, or other glitters for a sparkly metallic appearance; - catalysts; - sodium polyacrylate or similar hygroscopic polymers to make the surface hygroscopic or cause changes in shape with environmental humidity; ''' forms = ''' - 3-D printing; - bending a wire armature; - using an existing object such as a vase; - blowing glass; - vacuum-forming plastic; - blow-molding plastic; - electrotyping; - modeling with clay or other modeling compounds; - origami, whether with paper, sheets of PET or other plastic, aluminum foil, or other materials; - commanding a motorized reusable "armature" to assume a certain position until the papier-mâché draped over it hardens; - CNC machining; - cutting, folding, and assembling shapes out of cardboard or MDF, though this requires special attention to the adhesive's water content; - laser cutting; - piling up sand or other soil, whether with an additional binder or not; - assembling Legos, Meccano, Ramagon, Heckballs, modular T-slot aluminum framing, or other reusable "construction set" parts; - building latticework structures out of other kinds of members, for example, metal trusses or Tensegrities like Kenneth Snelson's; - manual carving of carveable materials such as metals, wood, foamed concrete, alabaster, graphite, lightweight refractory bricks, tuff, sandstone (natural or artificial), or papercrete; - hot-wire cutting of fusible foams such as styrofoam or polyisocyanurate; - inflatable shapes made in ways other than balloon twisting; for example, connecting sheets of polyethylene into a large balloon sculpture using a hot-wire heat-sealing machine; - assembly of a variety of objects, for example with hot glue; - forming sheet metal, for example by hammering, stamping, single-point incremental forming, or bead rolling; - assembling panels or other shapes cut or otherwise shaped from closed-cell polymer foam or other materials; - carpentry; - basket weaving, whether from traditional materials such as bamboo and rattan or non-traditional materials such as Ethernet cable and sheet-metal strips; - globoflexia ''' def parse_items(s): return [' '.join(textwrap.wrap(item)) for item in s.split('\n- ') if item.strip()] def format_list(items): return '\n'.join('- ' + '\n'.join(textwrap.wrap(item, subsequent_indent=' ')) for item in items) def select(item_string, termination_probability, min=1): items = parse_items(item_string) for _ in range(min): yield random.choice(items) while True: if random.random() <= termination_probability: return yield random.choice(items) def choice(): additive_list = format_list(select(additives, 0.7, min=0)) additive_text = ('Additives:\n{}\n\n'.format(additive_list) if additive_list else '') return 'Adhesives:\n{}\n\nFibers:\n{}\n\n{}Forms:\n{}\n'.format( format_list(select(adhesives, 0.9)), format_list(select(fibers, 0.9)), additive_text, format_list(select(forms, 0.9))) def main(): return '\n----\n\n'.join(choice() for _ in range(3)) if __name__ == '__main__': print(main())