Skip to content

Structure_Engine: Geometry3D Panel Extrusion method using wrong thickness and normal vector #3468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions Structure_Engine/Query/Geometry3D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ public static IGeometry Geometry3D(this Bar bar, bool onlyOuterExtrusion = true)

/***************************************************/

[Description("Gets a CompositeGeometry made of the boundary surfaces of the Panel, or only its central Surface.")]
[Description("Gets a CompositeGeometry made of the boundary surfaces of the Panel envelope, or only its central Surface.")]
[Input("panel", "The input panel to get the Geometry3D out of.")]
[Input("onlyCentralSurface", "If true, the returned geometry is only the central (middle) surface of the panel. Otherwise, the whole external solid is returned as a CompositeGeometry of many surfaces.")]
[Output("3d", "Three-dimensional geometry of the Panel.")]
[Output("3d", "Three-dimensional geometry of the Panel envelope.")]
public static IGeometry Geometry3D(this Panel panel, bool onlyCentralSurface = false)
{
if (panel.IsNull())
Expand All @@ -79,13 +79,14 @@ public static IGeometry Geometry3D(this Panel panel, bool onlyCentralSurface = f
else
{
CompositeGeometry compositeGeometry = new CompositeGeometry();
Vector localZ = centralPlanarSurface.Normal().Normalise();
double thickness = panel.Property.ITotalThickness();

double thickness = panel.Property.IVolumePerArea();
Vector translateVect = new Vector() { Z = -thickness / 2 };
Vector extrudeVect = new Vector() { Z = thickness };
Vector translateVect = localZ * -thickness / 2;
Vector extrudeVect = localZ * thickness;

Vector upHalf = new Vector() { X = 0, Y = 0, Z = thickness / 2 };
Vector downHalf = new Vector() { X = 0, Y = 0, Z = -thickness / 2 };
Vector upHalf = localZ * thickness / 2;
Vector downHalf = localZ * -thickness / 2;

PlanarSurface topSrf = centralPlanarSurface.ITranslate(upHalf) as PlanarSurface;
PlanarSurface botSrf = centralPlanarSurface.ITranslate(downHalf) as PlanarSurface;
Expand Down