Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

theilt20uae
en respuesta a: ltastan1

Here are the steps on how to offset a self-intersecting polyline without trimming the crossing lines:

  1. Offset the polyline by the desired distance. This can be done using a variety of methods, such as the offset_polyline() function from the shapely library.
  2. Identify any self-intersections in the offset polyline. This can be done using a variety of methods, such as the self_intersect() function from the shapely library.
  3. For each self-intersection, create a new vertex at the intersection point. This can be done using the intersection() function from the shapely library.
  4. Update the offset polyline to include the new vertices. This can be done by appending the new vertices to the offset polyline array.

Here is an example of how to offset a self-intersecting polyline without trimming the crossing lines using the shapely library:

 

As you can see, the offset polyline now includes the new vertices at the intersection points. This means that the polyline has been offset by 0.5 units without trimming the crossing lines.