Question

offsetcurvegenerator

  • 4 February 2015
  • 5 replies
  • 2 views

Hi there,

 

 

I try to use OffsetCurveGenerator to generate one sided buffers. I have a set of oriented polylines and the offset should always be generated on the left. But some are produced on the right side instead of the left side...

 

I checked the source polylines first and last coordinates to check the polylines orientation and it is always correct.

 

 

Is this problem known and is there a workaround to solve it?

 

 

In advance, many thanks for your help.

 

 

Best regards,

 

 

François

5 replies

Badge +3
Left/right is indeed dependend on lineorientation.

 

But weither you consider it left/right is also a matter of anglesize; in wich quadrant does a line lie.

 

 

If ofsetter seems to offset both sides, then some lines are  in different the quadrants.

 

You can check this if you have a label placed, label will be upside down.

 

Offsetter always places offset correctly to one side, if so chosen.

 

 

You can extrant the angles and check in wich quadrant they are. Reverse if nescessary. This way you can synchronise their orientation to have offsets to appear at the same side (tho technicilay it is then that they actually are on opposed sides)
Userlevel 2
Badge +17
Hi François,

 

 

As far as I know, the OffsetCurveGenerator always decides left/right correctly based on the original line orientation. If you found a case where the transformer cannot decide the direction correctly, I say it's a bug. I would recommend you to contact Safe support.

 

 

Takashi
Hi Gio and Takashi,

 

Many thanks for taking time to answer my question.

 

 

I also thought the OffsetCurveGenerator generates the line based on the source line direction (direction from the first to the last vertex coordinates)... Maybe I'm wrong?

 

I contacted the Safe support and sent them my workbench and data to clear this out. I will keep you updated.

 

 

Best regards,

 

François
Badge +3
It does do that correctly.

 

 

Maybe explode your polylines and reorient them? Check their validity?
Badge +3
This is transformer from a workspace i made, called zerostrokeoffsetter.

 

 

Affiner_2 [Affiner]

 

x' = 1x + 0y + @Evaluate($(Offsetside)*$(dist)*($(E_y)-$(S_y))/$(Length))

 

y' = 0x + 1y + @Evaluate(-$(Offsetside)*$(dist)*($(E_x)-$(S_x))/$(Length))

 

 

 

E and S are end and start point of linepiece and length its length.

 

Offsetside is 1 or -1.

 

dist is offsetdistance.

 

 

No horizontal lines, these u need to process seperately.

Reply