Hi,
I'm trying to write a script that gives me a parralellogram shaped section given 3 points of the contour and the centroid of the parralellogram. (So the script has to find the fourth point...).
Input is the aproximate parralellogram (incrv), the centroid (inPt) of the new parralellogram and an offset distance (dist) (to create a hollow section)
I'm new to grasshopper en VB-scripting. As intuiative grasshopper seems, so complex seems VB to me... So far I was able to make an offset of the curve, make a brep of the incrv and the offsetted curve and determine the centroid of that brep. The only thing I still need is to move the vertex of the incrv so I can make a recursive loop until the centroid of the brep coïncides with the inPt.
I'm confused of all the different types of curves and the different actions you can do with them, for example I can move the vertex of an onnurbcurve but I can't offset it. I can offset an oncurve but I can't move a vertex of it...
can anybody help? this is what I have so far (working with oncurve):
Private Sub RunScript(ByVal inCrv As OnCurve, ByVal inPt As On3dPoint, ByVal Dist As Double, ByRef A As Object, ByRef brepout As Object, ByRef cen As Object, ByRef area As Object)
Dim Normal As New On3dVector(0, 0, 1)
Dim outCrv() As OnCurve = Nothing
print("1ste punt: " & incrv.PointAt(0).x & ", " & incrv.PointAt(0).y & ", " & incrv.PointAt(0).z)
RhUtil.RhinoOffsetCurve(inCrv, Dist, inPt, Normal, 0, 0.1, outCrv)
Dim allCrv(1) As OnCurve
allCrv(0) = inCrv
allCrv(1) = outCrv(0)
Dim brep(0) As OnBrep
rhutil.RhinoMakePlanarBreps(allCrv, brep)
brepout = brep(0)
A = allCrv
Dim mp As New OnMassProperties()
brep(0).AreaMassProperties(mp, True, False, False)
cen = mp.Centroid