In Rhino 8 CAD I am having trouble with the _Drape command NOT behaving like a cloth would when draped over the tips of 3 parallel poles orthogonal to the draped surface. The 3 poles are 12’ high and are orthogonal to the xy plane and spaced apart from one another by 4 to 5 feet. I want to mimic draping a tarp or architectural membrane over them.
I have used the “_Drape” command but that does not work in the sense that no matter the “U/V” settings or the point spacing the fabric drapes to the ground plane around each pole rather than staying generally elevated in the triangular area between the tips of the poles ?.
The following pseudo code would use the spacing command to control the stiffness of the drape. So that for example if the UV spacing was greater than the pole spacing the drape would table on the pole tips and drape beyond the pole perimeter. Below is a simplified pseudocode outline for a potential algorithm improvement for the “_Drape” command:
function ImprovedDrape(U_spacing, V_spacing):
// Initialize variables
mesh_vertices =
mesh_edges =
catalogued_surfaces =
// Loop through Z axis from top to bottom
for each surface in descending order along Z axis:
// Check if surface is protruding from XY plane
if surface.protrudes_from_XY_plane():
// Add surface to catalogued list
catalogued_surfaces.append(surface)
// Check if there are any catalogued surfaces
if catalogued_surfaces is not empty:
// Loop through catalogued surfaces
for each catalogued_surface in catalogued_surfaces:
// Determine catenaries between catalogued surface and mesh edges
catenaries = determine_catenaries(catalogued_surface, mesh_edges)
// Generate mesh points along catenaries with specified spacing
new_mesh_points = generate_mesh_points(catenaries, U_spacing, V_spacing)
// Add mesh points to mesh vertices
mesh_vertices.append(new_mesh_points)
// Update mesh edges with new mesh points
mesh_edges = update_mesh_edges(new_mesh_points)
// Generate final mesh using mesh vertices and edges
final_mesh = generate_final_mesh(mesh_vertices, mesh_edges)
return final_mesh
This pseudocode outlines a potential improvement to the “_Drape” command’s algorithm.
Here’s a brief explanation of each step:
Initialize Variables: Set up lists to store mesh vertices, mesh edges, and catalogued surfaces.
Loop through Z Axis: Iterate through surfaces along the Z axis from top to bottom.
Catalogue Protruding Surfaces: Identify surfaces that protrude from the XY plane and add them to the catalogued list.
Check Catalogued Surfaces: If there are catalogued surfaces, loop through them.
Determine Catenaries: Determine catenaries between each catalogued surface and existing mesh edges.
Generate Mesh Points: Generate mesh points along the catenaries with specified U and V spacing.
Update Mesh: Update mesh vertices and edges with the newly generated mesh points.
Generate Final Mesh: Create the final mesh using the updated mesh vertices and edges.
This approach aims to improve the “_Drape” command by considering the relationships between protruding surfaces and existing mesh edges, generating mesh points along catenaries to better simulate the draped fabric behavior.
Adjustments to the U and V spacing can be made to control the density of the resulting mesh.