Skip to content

Instantly share code, notes, and snippets.

@danieltwagner
Created October 12, 2020 19:29
Show Gist options
  • Save danieltwagner/bd3eb2934a7e525788d71d73e8215a9f to your computer and use it in GitHub Desktop.
Save danieltwagner/bd3eb2934a7e525788d71d73e8215a9f to your computer and use it in GitHub Desktop.
outer := []triangolatte.Point{
{0.0990196078431369, 0},
{-9.802941176470586, 0},
{-9.802941176470586, -9.901960784313724},
{0.0990196078431369, -9.901960784313724},
}
hole := []triangolatte.Point{
{-1.980392156862743, -3.762745098039215},
{-1.980392156862743, -3.8617647058823525},
{-1.8813725490196056, -3.96078431372549},
{-1.8813725490196056, -4.059803921568627},
{-1.8813725490196056, -4.158823529411764},
{-1.8813725490196056, -4.257843137254902},
{-1.7823529411764683, -4.356862745098039},
{-1.7823529411764683, -4.455882352941176},
{-1.7823529411764683, -4.5549019607843135},
{-1.7823529411764683, -4.65392156862745},
{-1.7823529411764683, -4.752941176470587},
{-1.7823529411764683, -4.851960784313725},
{-1.7823529411764683, -4.950980392156862},
{-1.7823529411764683, -5.05},
{-1.7823529411764683, -5.149019607843137},
{-1.7823529411764683, -5.248039215686274},
{-1.7823529411764683, -5.347058823529411},
{-1.7823529411764683, -5.545098039215686},
{-1.7823529411764683, -5.644117647058823},
{-1.8813725490196056, -5.644117647058823},
{-1.8813725490196056, -5.74313725490196},
{-1.8813725490196056, -5.941176470588235},
{-1.8813725490196056, -6.0401960784313715},
{-1.980392156862743, -6.0401960784313715},
{-1.980392156862743, -6.238235294117647},
{-2.0794117647058803, -6.238235294117647},
{-2.0794117647058803, -6.436274509803921},
{-2.1784313725490176, -6.436274509803921},
{-2.1784313725490176, -6.6343137254901965},
{-2.277450980392155, -6.6343137254901965},
{-2.3764705882352923, -6.733333333333333},
{-2.3764705882352923, -6.931372549019608},
{-2.4754901960784297, -6.931372549019608},
{-2.4754901960784297, -7.030392156862746},
{-2.574509803921567, -7.030392156862746},
{-2.574509803921567, -7.129411764705883},
{-2.6735294117647044, -7.129411764705883},
{-2.6735294117647044, -7.22843137254902},
{-2.7725490196078417, -7.22843137254902},
{-2.7725490196078417, -7.3274509803921575},
{-2.871568627450979, -7.3274509803921575},
{-2.871568627450979, -7.426470588235295},
{-3.0696078431372538, -7.426470588235295},
{-3.168627450980391, -7.525490196078432},
{-3.168627450980391, -7.624509803921569},
{-3.366666666666666, -7.624509803921569},
{-3.366666666666666, -7.723529411764707},
{-3.5647058823529405, -7.723529411764707},
{-3.5647058823529405, -7.822549019607845},
{-3.762745098039215, -7.822549019607845},
{-3.762745098039215, -7.921568627450982},
{-3.8617647058823525, -7.921568627450982},
{-4.059803921568627, -7.921568627450982},
{-4.158823529411764, -7.921568627450982},
{-4.158823529411764, -8.020588235294118},
{-4.257843137254901, -8.020588235294118},
{-4.455882352941176, -8.020588235294118},
{-4.5549019607843135, -8.020588235294118},
{-4.65392156862745, -8.020588235294118},
{-4.752941176470587, -8.020588235294118},
{-4.851960784313725, -8.020588235294118},
{-4.950980392156862, -8.020588235294118},
{-5.05, -8.020588235294118},
{-5.149019607843137, -8.020588235294118},
{-5.248039215686274, -8.020588235294118},
{-5.347058823529411, -8.020588235294118},
{-5.446078431372548, -8.020588235294118},
{-5.545098039215686, -7.921568627450982},
{-5.644117647058823, -7.921568627450982},
{-5.74313725490196, -7.921568627450982},
{-5.842156862745098, -7.921568627450982},
{-5.941176470588235, -7.822549019607845},
{-6.0401960784313715, -7.822549019607845},
{-6.139215686274509, -7.723529411764707},
{-6.238235294117647, -7.723529411764707},
{-6.337254901960784, -7.624509803921569},
{-6.436274509803921, -7.624509803921569},
{-6.535294117647059, -7.525490196078432},
{-6.6343137254901965, -7.426470588235295},
{-6.733333333333333, -7.426470588235295},
{-6.83235294117647, -7.3274509803921575},
{-6.931372549019608, -7.22843137254902},
{-7.129411764705883, -7.030392156862746},
{-7.22843137254902, -6.931372549019608},
{-7.3274509803921575, -6.83235294117647},
{-7.3274509803921575, -6.733333333333333},
{-7.426470588235295, -6.6343137254901965},
{-7.525490196078432, -6.535294117647059},
{-7.525490196078432, -6.436274509803921},
{-7.624509803921569, -6.337254901960784},
{-7.624509803921569, -6.238235294117647},
{-7.723529411764707, -6.139215686274509},
{-7.723529411764707, -6.0401960784313715},
{-7.822549019607845, -5.941176470588235},
{-7.822549019607845, -5.842156862745098},
{-7.822549019607845, -5.74313725490196},
{-7.822549019607845, -5.644117647058823},
{-7.921568627450982, -5.545098039215686},
{-7.921568627450982, -5.446078431372548},
{-7.921568627450982, -5.347058823529411},
{-7.921568627450982, -5.248039215686274},
{-7.921568627450982, -5.149019607843137},
{-7.921568627450982, -5.05},
{-7.921568627450982, -4.950980392156862},
{-7.921568627450982, -4.851960784313725},
{-7.921568627450982, -4.752941176470587},
{-7.921568627450982, -4.65392156862745},
{-7.921568627450982, -4.5549019607843135},
{-7.921568627450982, -4.356862745098039},
{-7.921568627450982, -4.257843137254902},
{-7.822549019607845, -4.257843137254902},
{-7.822549019607845, -4.158823529411764},
{-7.822549019607845, -3.96078431372549},
{-7.822549019607845, -3.8617647058823525},
{-7.723529411764707, -3.8617647058823525},
{-7.723529411764707, -3.663725490196078},
{-7.624509803921569, -3.663725490196078},
{-7.624509803921569, -3.465686274509803},
{-7.525490196078432, -3.465686274509803},
{-7.525490196078432, -3.2676470588235285},
{-7.426470588235295, -3.2676470588235285},
{-7.3274509803921575, -3.168627450980391},
{-7.3274509803921575, -2.9705882352941164},
{-7.22843137254902, -2.9705882352941164},
{-7.22843137254902, -2.871568627450979},
{-7.129411764705883, -2.871568627450979},
{-7.129411764705883, -2.7725490196078417},
{-7.030392156862746, -2.7725490196078417},
{-7.030392156862746, -2.6735294117647044},
{-6.931372549019608, -2.6735294117647044},
{-6.931372549019608, -2.574509803921567},
{-6.83235294117647, -2.574509803921567},
{-6.83235294117647, -2.4754901960784297},
{-6.6343137254901965, -2.4754901960784297},
{-6.535294117647059, -2.3764705882352923},
{-6.535294117647059, -2.277450980392155},
{-6.337254901960784, -2.277450980392155},
{-6.337254901960784, -2.1784313725490176},
{-6.139215686274509, -2.1784313725490176},
{-6.139215686274509, -2.0794117647058803},
{-5.941176470588235, -2.0794117647058803},
{-5.941176470588235, -1.980392156862743},
{-5.842156862745098, -1.980392156862743},
{-5.644117647058823, -1.980392156862743},
{-5.545098039215686, -1.980392156862743},
{-5.545098039215686, -1.8813725490196056},
{-5.446078431372548, -1.8813725490196056},
{-5.248039215686274, -1.8813725490196056},
{-5.149019607843137, -1.8813725490196056},
{-5.05, -1.8813725490196056},
{-4.950980392156862, -1.8813725490196056},
{-4.851960784313725, -1.8813725490196056},
{-4.752941176470587, -1.8813725490196056},
{-4.65392156862745, -1.8813725490196056},
{-4.5549019607843135, -1.8813725490196056},
{-4.455882352941176, -1.8813725490196056},
{-4.356862745098039, -1.8813725490196056},
{-4.257843137254901, -1.8813725490196056},
{-4.158823529411764, -1.980392156862743},
{-4.059803921568627, -1.980392156862743},
{-3.9607843137254894, -1.980392156862743},
{-3.8617647058823525, -1.980392156862743},
{-3.762745098039215, -2.0794117647058803},
{-3.663725490196078, -2.0794117647058803},
{-3.5647058823529405, -2.1784313725490176},
{-3.465686274509803, -2.1784313725490176},
{-3.366666666666666, -2.277450980392155},
{-3.2676470588235285, -2.277450980392155},
{-3.168627450980391, -2.3764705882352923},
{-3.0696078431372538, -2.4754901960784297},
{-2.9705882352941164, -2.4754901960784297},
{-2.871568627450979, -2.574509803921567},
{-2.7725490196078417, -2.6735294117647044},
{-2.574509803921567, -2.871568627450979},
{-2.4754901960784297, -2.9705882352941164},
{-2.3764705882352923, -3.0696078431372538},
{-2.3764705882352923, -3.168627450980391},
{-2.277450980392155, -3.2676470588235285},
{-2.1784313725490176, -3.366666666666666},
{-2.1784313725490176, -3.465686274509803},
{-2.0794117647058803, -3.5647058823529405},
{-2.0794117647058803, -3.663725490196078},
}
poly, err := triangolatte.JoinHoles([][]triangolatte.Point{outer, hole})
if err != nil {
panic(fmt.Sprintf("JoinHoles failed: %s", err))
}
fmt.Println("Poly is", poly)
_, err = triangolatte.Polygon(poly)
if err != nil {
panic(fmt.Sprintf("Polygon failed: %s", err))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment