Variable offset

Hello,
thank you
I found a solution with explode twice (Thank you Mr. Vikram, for your availability and pugnacity)


cordially
christian.stan

1 Like

:ok_hand:

Below is a DS function with the double explode.
Hopefully will work with your Dynamo version too.

def unEqOffset (pgn,dst:var[]..[])
{
	crv = DSCore.List.Flatten(pgn.Explode().Explode(),-1);
	cr0 = DSCore.List.ShiftIndices(crv.Offset(dst),[1,0]);
	cr1 = cr0[0].ExtendEnd(cr0[0].Length*10);
	cr2 = cr0[1].ExtendStart(cr0[1].Length*10);
	pnt = DSCore.List.Flatten(cr1.Intersect(cr2),-1);
	return Polygon.ByPoints(pnt);
};

UnequalOffset.dyn (9.0 KB)

Actually your ‘pugnacity’ needs appreciation :slight_smile:

1 Like

Hello,
perfect thank you

Mr. Hassan will be able to put a solve.

Cordially
christian.stan

1 Like

thank you guys,
I want to point it out that i cannot seem to offset all sides inside or outside. mainly due to -+ sign on each offset. Shouldnt offset work either inside or outside, besides that, the script works.

1 Like

Negative value outside referent polygon

Cordially
christian.stan