Skip to main content
Solved

How do I add clothoids (spirals) to a geometry?


mariaka
Contributor
Forum|alt.badge.img+13

Hey there,

I need to transform a CSV-formatted file containing Geometry assignments into LandXML. Therefor geometry describing/containing clothoids need to be clothoids in the LandXML. They can be at the start, in the middle or at the end of a (line) geometry. I know how to create linear geometry (VertexCreator) and arc geometry (2DArcReplacer). But clothoids? 🤷‍♀️

Best answer by nielsgerrits

You can create a clothoid using a Creator transformer. 

As an extra you can use a GeometryExtractor (encoding FME XML) to get an XML describing the parameters: 

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<geometry>
	<clothoid>
		<startCoord x="0" y="0"></startCoord>
		<endCoord x="-0.27390607603951506" y="1.0140946349460176"></endCoord>
		<localStartCoord x="0" y="0"></localStartCoord>
		<startDirection>0</startDirection>
		<startCurvature>1</startCurvature>
		<endCurvature>2</endCurvature>
		<length>3</length>
	</clothoid>
</geometry>

Next you can edit these parameters in the XML and recreate the geometry from XML using the GeometryReplacer.

View original
Did this help you find an answer to your question?

10 replies

nielsgerrits
VIP
Forum|alt.badge.img+54
  • Best Answer
  • September 28, 2022

You can create a clothoid using a Creator transformer. 

As an extra you can use a GeometryExtractor (encoding FME XML) to get an XML describing the parameters: 

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<geometry>
	<clothoid>
		<startCoord x="0" y="0"></startCoord>
		<endCoord x="-0.27390607603951506" y="1.0140946349460176"></endCoord>
		<localStartCoord x="0" y="0"></localStartCoord>
		<startDirection>0</startDirection>
		<startCurvature>1</startCurvature>
		<endCurvature>2</endCurvature>
		<length>3</length>
	</clothoid>
</geometry>

Next you can edit these parameters in the XML and recreate the geometry from XML using the GeometryReplacer.


mariaka
Contributor
Forum|alt.badge.img+13
  • Author
  • Contributor
  • September 28, 2022

So the Creator is just a "helper transformer" to get the XML description?


nielsgerrits
VIP
Forum|alt.badge.img+54

It can have different functions, but I use it to generate geometries like these or initiate FeatureReaders.


david_r
Celebrity
  • September 29, 2022

I'll just add that you can use the PathBuilder to join polylines, arcs and clothoids into a single line geometry.


mariaka
Contributor
Forum|alt.badge.img+13
  • Author
  • Contributor
  • October 13, 2022
david_r wrote:

I'll just add that you can use the PathBuilder to join polylines, arcs and clothoids into a single line geometry.

Screenshot LineCombiner LogBut PathBuilder closes the geometry. How can I prevent this? LineCombiner throws an error when connecting all the lines, arcs and clothoids.


david_r
Celebrity
  • October 13, 2022
mariaka wrote:

Screenshot LineCombiner LogBut PathBuilder closes the geometry. How can I prevent this? LineCombiner throws an error when connecting all the lines, arcs and clothoids.

Can you show us a screenshot of the result returned by the PathBuilder, as well as a what you would like to have?


mariaka
Contributor
Forum|alt.badge.img+13
  • Author
  • Contributor
  • October 14, 2022
mariaka wrote:

Screenshot LineCombiner LogBut PathBuilder closes the geometry. How can I prevent this? LineCombiner throws an error when connecting all the lines, arcs and clothoids.

Sure, first picture: single line feaures [7]

 

Screenshot unjoined Lines 

Second picture: one closed path

Screenshot PathBuilder 

My allover goal is to create the geometry from a data format called XTR (TopoRail - from Swiss Federal Railways SBB). The geometry is defined with parameters for lines, arcs and clothoids (aka curves, spirals). Besides the problem of connectiong single lines into one I struggle with creating clothoids. With the Creator as a helper transformer I now know how to define them. But I don't know how to calculate the parameters 'endCoord', 'startCurvature' and 'endCurvature'. I guess it's just algebra, but I cannot find the correct formular.

I have following parameters given:

StartCoordinates x, y (m)

StartDirection (gon)

Length (m)

StartRadius (m)

EndRadius (m)

 

Any ideas?


david_r
Celebrity
  • October 14, 2022
mariaka wrote:

Screenshot LineCombiner LogBut PathBuilder closes the geometry. How can I prevent this? LineCombiner throws an error when connecting all the lines, arcs and clothoids.

Concerning the PathBuilder, you may have to make sure that the elements arrive to the transformer in the correct logical order, and that they are oriented in the order of the complete line. From the documentation of the PathBuilder:

If the end point of one input segment does not match the following segment's start point, geometry will be added to connect them in the following way.

That might perhaps explain what you're observing.


mariaka
Contributor
Forum|alt.badge.img+13
  • Author
  • Contributor
  • October 14, 2022
mariaka wrote:

Screenshot LineCombiner LogBut PathBuilder closes the geometry. How can I prevent this? LineCombiner throws an error when connecting all the lines, arcs and clothoids.

Yes! Thanks @david_r​ ! I was already sure the lines are correctly sorted, but weren't.


mariaka
Contributor
Forum|alt.badge.img+13
  • Author
  • Contributor
  • October 20, 2022

In case someone needs to know more about clothoids: http://ww3.cad.de/foren/ubb/uploads/Clayton/Klothoide-Formeln.pdf [german] helped me a lot!


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