AsapSections has been incorporated into AsapToolkit.jl
Analysis of arbitrary polygonal cross sections.
Create a solid cross section (SolidSection <: PolygonalSection) via:
section = SolidSection(points::Vector{Vector{Float64}})Where points is an ordered list of vertex positions, either clockwise or anti-clockwise
or
section = SolidSection(points::Matrix{Float64})Where points is a [2 × n] matrix of vertex positions.
A SolidSection provides the following fields:
- points: a matrix of section vertex positions
- centroid: a vector of the centroid position
- area: cross section area
- Ix: second moment of area about X-axis situated at centroid
- Iy: second moment of area about Y-axis situated at centroid
- Sx: section modulus about X-axis
- Sy:section modulus about Y-axis
- xmin, xmax: extreme X-positions of section
- ymin, ymax: extreme Y-positions of section
E.g.:
#make a T section
flange_width = 250.
depth = 400.
flange_thickness = 50.
web_thickness = 30.
p1 = [0., 0.]
p2 = p1 + [flange_width, 0]
p3 = p2 - [0, flange_thickness]
p4 = p3 - [(flange_width - web_thickness) / 2, 0]
p5 = p4 - [0, depth - flange_thickness]
p6 = p5 - [web_thickness, 0]
p7 = p6 + [0, depth - flange_thickness]
p8 = p7 - [(flange_width - web_thickness) / 2, 0]
section_vertices = [
p1,
p2,
p3,
p4,
p5,
p6,
p7,
p8
]
section = SolidSection(section_vertices)To reposition the vertices such that the centroid is at the origin, use:
center_at_centroid!(section::PolygonalSection)To rotate a section about its centroid:
rotate_section!(section::PolygonalSection, angle::Float64)Where angle is the anti-clockwise rotation angle in radians.
To rigidly translate a section:
translate_section!(section::PolygonalSection, vector::Vector{Float64})Where vector is the 2D translational vector.
Get a map of the cumulative area, A, enclosed by the original section at a horizontal line at depth y from the top of the section:
y, A = depth_map(section::AbstractPolygonalSection; n = 250)Where n is the number of samples taken along the depth of the section.
Get the values of cumulative area, A, enclosed at a series of absolute y positions in y::Vector{Float64}.
A = depth_map(section::AbstractPolygonalSection, y::Vector{Float64})Performs the Sutherland-Hodgman Algorithm to get the vertices or a SolidSection of the clipped geometry caused by a horizontal line at depth y from the top of the section:
clipped_vertices = sutherland_hodgman(section::PolygonalSection, y::Float64)
clipped_section = sutherland_hodgman(section::PolygonalSection, y::Float64; return_section = true)sutherland_hodgman_abs is also provided for an absolute value clipping line.
Get the area above a depth depth from the top of the section:
E.g.:
#area from depth
d = 150.
A_at_d = area_from_depth(section, d)Get the depth required to enclose a target area area.
depth_from_area(section::AbstractPolygonalSection, area::Float64; max_iter = 500, rel_tol = 1e-3, show_stats = true)This is an iterative process with a default maximum number of iterations of 500, and a relative stopping tolerance of 0.1%. show_stats outputs the total number of iterations and the final error of the solution.
E.g.:
#depth from area
Arequired = 4000.
d_at_A = depth_from_area(section, Arequired)Create a compound section from multiple sections.
E.g.:
circle_radius = 5.
base1 = [-10., -350.]
base2 = [10., -350.]
n = 50
circle_pts_1 = [circle_radius .* [cos(thet), sin(thet)] .+ base1 for thet in range(0, 2pi, n)]
circle_pts_2 = [circle_radius .* [cos(thet), sin(thet)] .+ base2 for thet in range(0, 2pi, n)]
circle1 = SolidSection(circle_pts_1)
circle2 = SolidSection(circle_pts_2)
compound = CompoundSection([section, circle1, circle2])All utility functions listed above also work for compound sections, with the exception of sutherland_hodman.
Make a section whose properties are with respect to a center of rotation that is not the centroid of the section.
center_of_rotation = [200., 500.]
offset_section = OffsetSection(section, center_of_rotation)




