|
| 1 | +clear all |
| 2 | + |
| 3 | +u = py.importlib.import_module('xara.units.iks'); |
| 4 | +xs = py.importlib.import_module('xsection'); |
| 5 | +veux = py.importlib.import_module('veux'); |
| 6 | +xs = py.importlib.reload(xs); |
| 7 | + |
| 8 | + |
| 9 | +d = 18*u.inch; % depth |
| 10 | +b = 20*u.inch; % width |
| 11 | +t = 6*u.inch; % thickness |
| 12 | +cover = 2*u.inch; |
| 13 | + |
| 14 | +% |
| 15 | +% Create composite shape |
| 16 | +% |
| 17 | + |
| 18 | +% Create patches |
| 19 | +flange = xs.library.Rectangle(t, d); |
| 20 | +web = xs.library.Rectangle(b, t).translate({0, -d/2-t/2}); |
| 21 | + |
| 22 | +% Combine into one shape |
| 23 | +section = xs.CompositeSection({web, flange}); |
| 24 | + |
| 25 | +% |
| 26 | +% Add reinforcement |
| 27 | +% |
| 28 | + |
| 29 | +% Create a shape representing a single rebar. The parameter z=2 will ensure |
| 30 | +% this material takes priority over the concrete of the rectangular flange |
| 31 | +bar = xs.library.Circle(0.4, z=2, mesh_scale=1, divisions=int32(10)); |
| 32 | + |
| 33 | +% Now replicate the rebar |
| 34 | +ri = {-(b/2-cover), -d/2-t/1.5}; |
| 35 | +rj = { b/2-cover , -d/2-t/1.5}; |
| 36 | +top_bars = bar.linspace(ri, rj, int32(4)); |
| 37 | + |
| 38 | +% section.add_patches(top_bars); |
| 39 | + |
| 40 | +% section = section.translate(section.centroid); |
| 41 | + |
| 42 | +% |
| 43 | +% Visualization |
| 44 | +% |
| 45 | +artist = veux.create_artist(section.model); |
| 46 | +artist.draw_outlines(); |
| 47 | +artist.draw_surfaces(); %field=section.torsion_warping() |
| 48 | +artist.save("tee.glb"); |
| 49 | +% veux.serve(artist); |
| 50 | +surfaceMeshShow(readSurfaceMesh("tee.glb"), BackgroundColor="white"); |
0 commit comments