Is there some similar function available for Microstation which would allow to draw line as centerline between two lines or curves?
AutoLISP: Advanced Polyline Offset | AutoCAD Tips (autocadtips1.com)
Oto said:Is there some similar function available for MicroStation
The tool you cite is written in AutoLisp. It's not a 'function in AutoCAD': it's code that someone has written for AutoCAD.
MicroStation doesn't have Lisp but it does have VBA. You can write code in VBA — a macro — that does something similar.
The Lisp code is rather constrained: it requires two line-strings (polylines) that are approximately parallel, each having the same number of vertices. It works by constructing a line between matching vertices, finding the mid-point of each line, then drawing the 'centre-line' between those mid-points.
Oto said:between two lines or curves
The Lisp code only works with lines having a finite number of vertices. It doesn't work with curves.
That should work with a line-string or curve.
Here's a solution that works for lines or curves. The VBA has two different methods that create temporary chords and then constructs a centre-line.
Regards, Jon Summers LA Solutions
Hi Oto,
Oto said:Is there some similar function available for Microstation which would allow to draw line as centerline between two lines or curves?
There is no such tool in MicroStation and I do not recall any such (VBA) macro discussed.
As Jon wrote, the tool you linked requires specific configuration of lines (otherwise results is probably not correct), on the other hand the code is simple.
What is a context in what you would like to use such tool?
Method described by Jon is better and more flexible, but what I remember from cartography generalization, different solutions how to calculate "centerline" exists, each with own set of pros and cons.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Context is surveying for example construct road centerline when it is not marked.My first attempts created a mess of lines. Seems not that simple:
Looks like you've been using the Place Stream Line String tool
So.... What exactly did you do in your initial attempt???
Tried to find middle point as perpendicular from top line to bottom and draw a line from these points.
Are you working with curves or just linestrings?
Oto said:Context is surveying for example construct road centerline when it is not marked.
It probably makes the situation simpler, because situations like "crossing borders" or "borders with extremely different geometry or length" can be ignored.
Oto said:Seems not that simple:
To create centerline (sometimes called skeleton, when more complex geometry is analyzed) is not simple task at all. Moreover, there is no one approach, that can serve all requirements.
Fortunately, context can make the algorithm substantially simpler: Borders of streets, described as line strings, are probably fine (not complex chains, no crossing borders...).
Approach described by Jon is simple, even my feeling is (based on experience from time I cooperate on cartography generalization projects) that it does not provide always right results. But, "simple" still requires to implement plenty of checks and geometry analysis.
Regards,
Jan Šlegr said:Approach described by Jon is simple, even my feeling is (based on experience from time I cooperate on cartography generalization projects) that it does not provide always right results. But, "simple" still requires to implement plenty of checks and geometry analysis.
The constrained solution as outlined by Jon is of course the simplest but Oto needs to confirm it that suffices, or if the more complex route is necessary. Oto, if the former applies, this image should give you some hints how your code should be arranged to operate.
BTW I found this wiki page, but it works in 3D only
Yes this is another solution but too complicated and not usable in 2D.