Duplicate points in generated mesh

Bug #1175555 reported by Stephan Kramer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Meshing to Realistic Domains
New
Undecided
Unassigned

Bug Description

When meshing a domain with islands, each of the different parts of the boundary, except the last part, obtains a spurious extra point and corresponding zero-lenghth line. The offending code is input_output_for_id.py, line 47:

                                       splitPoints.append(len(points)-1)
                                        for i in range(len(splitPoints)-1):
                                                ptList = (points[splitPoints[i]:splitPoints[i+1]])
                                                if is_domain and Polygon(ptList).area > threshold:
                                                        regionIDs.append(ID)
                                                        pointsList.append(ptList)
                                                        PartNumber += 1
                                                if is_domain :
                                                        pointsList[-1].append(pointsList[-1][0])

Here splitPoints is the array that indicates the beginning of each part of a multi-part shape, so that as indicated above part 'i' consists of the points points[splitPoints[i]:splitPoints[i+1]], i.e up until (not including) splitPoint[i+1] which is where the next part starts. Now for the last part the 'i+1' does not exist, so in the first line of the code snippet above it adds an extra entry. That extra entry should however have been 'len(points)' and not' len(points)-1', so that the last part ranges splitPoint[N]:len(points). Currently it thus misses out the last point of the last part of the shape, thus the polygons would not be closed. In what looks like an attempt to fix this, in the last two lines the first point of each part is repeated and added to the end. Because this is done for each part however this leads to spurious extra nodes for all but the last parts of the shape. I'll commit a fix on a branch shortly.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.