Please clarify Sketch.offset documentation

Please clarify Sketch.offset documentation

gscotti
Enthusiast Enthusiast
424 Views
1 Reply
Message 1 of 2

Please clarify Sketch.offset documentation

gscotti
Enthusiast
Enthusiast

I'm really confused about what directionPoint means. Does it mean if it is inside the loop the offset is inwards aod if it is outside it is outwards? In this case, what does it mean to have a negative offset value?

 

 

 

0 Likes
425 Views
1 Reply
Reply (1)
Message 2 of 2

marshaltu
Autodesk
Autodesk

Hello,

 

"directionPoint" was designed for specifying the direction of offset. Sometimes it is difficult to define the offset direction if the curves are not a loop. For example: for a single line, api clients would have no idea which direction offset line will go with if we only give positive/negative offset value. In UI side, the offset preview can give the hint of direction when users input positve/nagetive offset value.

 

For general purpose, Sketch.offset API would depend on "directionPoint" to decide offset direction, accept only positive offset value and ignore negative one users give.

 

Thanks,

Marshal



Marshal Tu
Fusion Developer
>
0 Likes