Skip to main content
Question

move lien to make parallel to a reference line


boubcher
Contributor
Forum|alt.badge.img+11

Hello there

how could we move the blue line in order to make it parallel to the read one?

paralel

8 replies

takashi
Influencer
  • March 16, 2022

Hi @boubcher​ , take a look at the OffsetCurveGenerator transformer.


boubcher
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • March 16, 2022
takashi wrote:

Hi @boubcher​ , take a look at the OffsetCurveGenerator transformer.

@Takashi Iijima​ 

the transformer creates a parallel line right and left to the same line input, in our case, we have 2 input lines blue and read and we need to make the blue line parallel to the read line. could u advise

thanks


geomancer
Evangelist
Forum|alt.badge.img+50
  • Evangelist
  • March 16, 2022
takashi wrote:

Hi @boubcher​ , take a look at the OffsetCurveGenerator transformer.

Unfortunately you provide too little information for a helpful answer.

At what distance from the blue line should the red line be? The (orthogonal) distance of the starting point of the red line from the blue line? Or the (orthogonal) distance of the end point? Or maybe the (orthogonal) distance of the middle of the red line from the blue line? Or even the (orthogonal) distance of the middle of the blue line from the red line? Or some other distance?

Should the length of red line be changed to te same length as the blue line?


kailinatsafe
Safer
Forum|alt.badge.img+21

Hello @boubcher​ , I think you can use the AnchoredSnapper to snap blue line to red, and then use an Offsetter to offset on y-axis (eg. move it down)? Best, Kailin.


ctredinnick
Supporter
Forum|alt.badge.img+19
  • Supporter
  • March 17, 2022

For each line calculate its bearing (HorizontalAngleCalculator). Use the NeighbourFinder to copy that attribute across from the red line to the blue line. This will mean the blue line will have attributes of the distance, direction between the lines, and the bearings of each line. From that you can use a Rotator (rotate by the difference in bearings) or Offsetter to move the lines to get what you need.


boubcher
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • March 17, 2022
ctredinnick wrote:

For each line calculate its bearing (HorizontalAngleCalculator). Use the NeighbourFinder to copy that attribute across from the red line to the blue line. This will mean the blue line will have attributes of the distance, direction between the lines, and the bearings of each line. From that you can use a Rotator (rotate by the difference in bearings) or Offsetter to move the lines to get what you need.

@ctredinnick​ 

I am getting some weird number of the angle value there is a large difference but as you can see they are close to each other is there any reason

because if we rotate as suggested by the diff angle, the blue line will go to another country

angle value 


ctredinnick
Supporter
Forum|alt.badge.img+19
  • Supporter
  • March 17, 2022
boubcher wrote:

@ctredinnick​ 

I am getting some weird number of the angle value there is a large difference but as you can see they are close to each other is there any reason

because if we rotate as suggested by the diff angle, the blue line will go to another country

angle value 

There's two things - lines which are drawn in an opposite direction will have an azimuth 180 degrees from each other, so the difference between the two is: 89 - (268-180), which is only 0.93499761. If you're doing this for a lot of lines, you'll need some conditional statements to keep the values between 0 and 180, such as if an azimuth is greater than 180, subtract it by 180.

Then the rotator's default behaviour is to use 0,0 as the centre of rotation. So you'll need use a coordinate extractor to get the coordinate to rotate around, like the line's first vertex, or its centrepoint.


boubcher
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • March 18, 2022
boubcher wrote:

@ctredinnick​ 

I am getting some weird number of the angle value there is a large difference but as you can see they are close to each other is there any reason

because if we rotate as suggested by the diff angle, the blue line will go to another country

angle value 

@ctredinnick​ 

Yes you are right all work good now , Thanks for your help

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings