|
|
|
Polygon_Tolerance_Selector |
|
The following GC (08.09.05.43) Script is an interactive parametrically controlled script to help locate polygons that are "in plane" within given tolerances.
The studio is currently looking into scripts to automate the planarization of complex surfaces. This entails all panels of a complex surface are flat and thereby simplifies its production and reduces economic burdens typically associated with complex surface geometries.
The image depicts red planar panels (within a given tolerance) and white non-planar panels.
transaction modelBased "Some Points"
{
feature point01 GC.Point
{
CoordinateSystem = baseCS;
XTranslation = <free> (-26.3650556776066);
YTranslation = <free> (25.3611399710753);
ZTranslation = <free> (0.0);
HandlesVisible = true;
}
feature point02 GC.Point
{
CoordinateSystem = baseCS;
XTranslation = <free> (-3.31795107230648);
YTranslation = <free> (24.7909057295036);
ZTranslation = <free> (0.0);
HandlesVisible = true;
}
feature point03 GC.Point
{
CoordinateSystem = baseCS;
XTranslation = <free> (23.8010801417039);
YTranslation = <free> (25.1167538675445);
ZTranslation = <free> (0.0);
HandlesVisible = true;
}
feature point04 GC.Point
{
CoordinateSystem = baseCS;
XTranslation = <free> (23.6382030773555);
YTranslation = <free> (-0.0550147961216222);
ZTranslation = <free> (0.0);
HandlesVisible = true;
}
feature point05 GC.Point
{
CoordinateSystem = baseCS;
XTranslation = <free> (24.4525883990976);
YTranslation = <free> (-22.6199983554599);
ZTranslation = <free> (0.0);
HandlesVisible = true;
}
feature point06 GC.Point
{
CoordinateSystem = baseCS;
XTranslation = <free> (-0.304725381860882);
YTranslation = <free> (-23.1087705625214);
ZTranslation = <free> (0.0);
HandlesVisible = true;
}
feature point07 GC.Point
{
CoordinateSystem = baseCS;
XTranslation = <free> (-27.1794409993487);
YTranslation = <free> (-23.0273085280111);
ZTranslation = <free> (0.0);
HandlesVisible = true;
}
feature point08 GC.Point
{
CoordinateSystem = baseCS;
XTranslation = <free> (-26.7722483384777);
YTranslation = <free> (0.189371307409118);
ZTranslation = <free> (0.0);
HandlesVisible = true;
}
feature point09 GC.Point
{
CoordinateSystem = baseCS;
XTranslation = <free> (-0.0604097853382642);
YTranslation = <free> (4.50685913645218);
ZTranslation = <free> (0.0);
HandlesVisible = true;
}
}
transaction modelBased "Some Curves"
{
feature bsplineCurve01 GC.BSplineCurve
{
Poles = {point01,point02,point03};
Order = 4;
}
feature bsplineCurve02 GC.BSplineCurve
{
Poles = {point08,point09,point04};
Order = 4;
}
feature bsplineCurve03 GC.BSplineCurve
{
Poles = {point07,point06,point05};
Order = 4;
}
}
transaction modelBased "Some Surface"
{
feature bsplineSurface01 GC.BSplineSurface
{
Curves = {bsplineCurve01,bsplineCurve02,bsplineCurve03};
Order = 4;
}
feature point02 GC.Point
{
ZTranslation = <free> (-23.5204949828528);
}
feature point04 GC.Point
{
ZTranslation = <free> (-14.3500492855672);
}
feature point06 GC.Point
{
ZTranslation = <free> (30.4832407900511);
}
feature point08 GC.Point
{
ZTranslation = <free> (22.8412027089798);
}
}
transaction modelBased "UV for rapid testing"
{
feature point10 GC.Point
{
Surface = bsplineSurface01;
U = Series(0,1,0.1);
V = Series(0,1,0.1);
HandlesVisible = true;
Replication = ReplicationOption.AllCombinations;
}
}
transaction modelBased "Hide Some Stuff"
{
feature bsplineCurve01 GC.BSplineCurve
{
Visible = false;
}
feature bsplineCurve02 GC.BSplineCurve
{
Visible = false;
}
feature bsplineCurve03 GC.BSplineCurve
{
Visible = false;
}
feature bsplineSurface01 GC.BSplineSurface
{
Visible = false;
}
}
transaction modelBased "Some Poly from UVs"
{
feature polygon01 GC.Polygon
{
Points = point10;
Visible = true;
}
}
transaction modelBased "Adjust Poly colr Property for Visuals"
{
feature polygon01 GC.Polygon
{
Color = polygon01.OutOfPlane<0.05?3:0;
}
}
transaction modelBased "Sel Shape graphFunction"
{
feature selectedPolygons GC.Polygon
{
Function = function (Polygon allPoly)
{
Polygon outOfPlane = {};
for (int i = 0; i < allPoly.Count; ++i)
{
for (int j = 0; j < allPoly[i].Count; ++j)
{
if (allPoly[i][j].OutOfPlane < 0.05)
{
//outOfPlane[outOfPlane.Count+1] = allPoly[i][j];
outOfPlane[outOfPlane.Count+1] = new Polygon().ByVertices(allPoly[i][j].Vertices);
}
}
}
return outOfPlane;
};
FunctionArguments = {polygon01};
}
}
transaction modelBased "Hide Out of Tolerance Polys"
{
feature polygon01 GC.Polygon
{
Visible = false;
}
feature selectedPolygons GC.Polygon
{
Function = function (Polygon allPoly)
{
Polygon outOfPlane = {};
for (int i = 0; i < allPoly.Count; ++i)
{
for (int j = 0; j < allPoly[i].Count; ++j)
{
if (allPoly[i][j].OutOfPlane < 0.05)
{
//outOfPlane[outOfPlane.Count+1] = allPoly[i][j];
outOfPlane[outOfPlane.Count+1] = new Polygon().ByVertices(allPoly[i][j].Vertices);
}
}
}
return outOfPlane;
};
SymbolicModelDisplay = null;
Color = 3;
RoleInExampleGraph = null;
}
}
transaction modelBased "Hide Original Some Poly"
{
feature polygon01 GC.Polygon
{
Visible = false;
}
}
transaction modelBased "Adjust Some Points"
{
feature point01 GC.Point
{
ZTranslation = <free> (20.3188221773417);
}
feature point02 GC.Point
{
ZTranslation = <free> (9.79191047337049);
}
feature point03 GC.Point
{
ZTranslation = <free> (-12.3066928685943);
}
feature point07 GC.Point
{
ZTranslation = <free> (42.4415501180886);
}
}
|
Built with GC 08.09.05.43
This application is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

GC Script Polygon Tolerance Selector by cdmb architects is licensed under a Creative Commons Attribution 2.0 Germany License.
|
|
|