Why does PolyCurve.Fillet fail

its completely random
sometimes it works and sometimes it doesn’t

Hello @gosayi2789 Welcome to the community! :wink: you can try something here and see if it could be better…

test fillet.dyn (13.2 KB)

1 Like

PS spring package should have one there could work as well written in designscript but basically do the same as the python

1 Like

thanks for reply it worked but as i dont know python, i would prefere a node rather than a python script
but i couldnt find the node form springs, may you provide the full name
thanks

great…guess the name is something like fillet+ but cant remember i dont use spring in the moment…but you could just create a dyf custom node with shared python…almost the same

1 Like

ye ty found it
but for some reason it fails to work and gives null
curves are much larger than the radius iam giving

You can connect 2 polycurve.fillet nodes to the output of polycurve by grouped curves, one with clockwise_corners set to false and one left with no input (default value is true)

if i remember that one is written in ds script try copy that codeblock to canvas and see if it give some warnings

ye it gives warnings while the ootb node works here

i believe thats what i did in the picture above
but it acts weird
sometimes it works and sometimes it doesnt

allright as mention i dont use spring i have just tried create my own with python just for practice ;)…and until now it seems very stable…

The ‘clockwise_corners’ input needs to be boolean or just type false in a code block.

i just tried it on revit 2024 and it worked. on 2025 it didnt

iam sticking with the python script for now
thanks

1 Like

allright…could you share this codeblock here ?

c = pc.Curves();
isClosed = pc.IsClosed;
shift = isClosed ? 1 : 0;
c0 = DSCore.List.ShiftIndices(c, shift);
drop = isClosed ? 0 : 1;
c0f = DSCore.List.DropItems(c0, drop);
a1 = Arc.ByFillet(c, c0f, r);
p1 = a1.StartPoint;
shift1 = isClosed ? -1 : 1;
p2 = DSCore.List.ShiftIndices(a1.EndPoint, shift1);
par1 = c.ParameterAtPoint(p1);
par2 = c.ParameterAtPoint(p2);
par1f = isClosed ? par1 : par2;
par2f = isClosed ? par2 : par1;
par1f[0] = isClosed ? par1f[0] : 0;
c1 = c.TrimByParameter(par1f, par2f);
c2 = [Imperative]{
if (isClosed)
{
return = PolyCurve.ByJoinedCurves(Flatten(
List.Transpose([c1, a1]) ) );
}
else
{
parE = c[-1].ParameterAtPoint(p2[0]);
cE = c[-1].TrimByParameter(parE,1);
return = PolyCurve.ByJoinedCurves(Flatten(
[List.Transpose([c1, a1]), cE]) );
}
};

i believe 0 in a code block is considered like a false boolean

Check the warning, it should say that 0 is an integer

1 Like

cheers works great here you probably have some issues with names try DSCore. or Autodesk. Autodesk.DesignScipt. before polycurve by joined curves… try as here and see if it could be better :wink: i canr really test here as it works here without…


fillet.dyn (15.1 KB)

Design script is your friend here - Here is a clean way based on original idea of chaining the fillet function


Edit: Since DesignScript is object oriented you can also do something like this

PCF = PolyCurve.Fillet;
PCF(PCF(polyCurve, radius, true), radius, false);

You aren’t passing the 0 in a code block, but returning from the code block a 0 and then passing that into a Boolean.

Usually when I have studied why filler fails it has always come down to not being able to fit the fillet as one of the tangent points falls before the start of the curve.

2 Likes