Skip to content

Offset failure #59

@timoria21

Description

@timoria21

Hello,

I have the following offset sample with an open polyline, and I cannot get a proper result; it seems that if I somehow ignore the result of the intersection with the circles of radius equals to the offset performed in dualSliceAtIntersectsForOffset() method (file: polylineoffset.hpp), I can get the wanted result.

Is there a reason that can explain the initial error? What is the main logic behind this circles intersections?

Pseudocode:

List<PlineVertex> pts = new List<PlineVertex>()
{
    new PlineVertex(-18.2193583535761, 0, 0),
    new PlineVertex(-18.2193583535761, -0.1875, 0),
    new PlineVertex(-3.8125, -0.1875, 0),
    new PlineVertex(-2.8125, -0.1875, 0),
    new PlineVertex(-2.8125, -0.174999997019768, 0),
    new PlineVertex(-1.3125, -0.174999997019768, 0),
    new PlineVertex(-1.3125, -0.1875, 0),
    new PlineVertex(-6.12372410773971E-05, -0.187499990000001, 0.414309224131129),
    new PlineVertex(0.1875, 0, 0)
}

Polyline currIsland = new Polyline(false, pts)

OffsetLoopSet loopSet = new cavc.OffsetLoopSet()
Polyline.invertDirection(currIsland)
loopSet.cwLoops.Add(new OffsetLoop(0, currIsland, Polyline.createApproxSpatialIndex(currIsland)))
double offsetDelta = 2e-5

ParallelOffsetIslands alg = new cavc.ParallelOffsetIslands()
OffsetLoopSet offsetResult = alg.compute(loopSet, offsetDelta)

Thanks,

Dave

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions