Changeset View
Changeset View
Standalone View
Standalone View
mesh_bsurfaces.py
| Context not available. | |||||
| if dist <= self.crosshatch_merge_distance * 1.5: | if dist <= self.crosshatch_merge_distance * 1.5: | ||||
| temp_co, percent1 = mathutils.geometry.intersect_point_line(intersec_coords[0], bp1_co, bp2_co) | temp_co, percent1 = mathutils.geometry.intersect_point_line(intersec_coords[0], bp1_co, bp2_co) | ||||
| if (percent1 >= -0.02 and percent1 <= 1.02): | if percent1 >= -0.02 and percent1 <= 1.02: | ||||
| temp_co, percent2 = mathutils.geometry.intersect_point_line(intersec_coords[1], bp3_co, bp4_co) | temp_co, percent2 = mathutils.geometry.intersect_point_line(intersec_coords[1], bp3_co, bp4_co) | ||||
| if (percent2 >= -0.02 and percent2 <= 1.02): | if percent2 >= -0.02 and percent2 <= 1.02: | ||||
| all_intersections.append((i, t, percent1, ob_splines.matrix_world * intersec_coords[0])) # Format: spline index, first point index from corresponding segment, percentage from first point of actual segment, coords of intersection point. | all_intersections.append((i, t, percent1, ob_splines.matrix_world * intersec_coords[0])) # Format: spline index, first point index from corresponding segment, percentage from first point of actual segment, coords of intersection point. | ||||
| all_intersections.append((i2, t2, percent2, ob_splines.matrix_world * intersec_coords[1])) | all_intersections.append((i2, t2, percent2, ob_splines.matrix_world * intersec_coords[1])) | ||||
| Context not available. | |||||
| verts_tips_parsed_idx = [] | verts_tips_parsed_idx = [] | ||||
| if len(all_chains_tips_idx) >= 2: | if len(all_chains_tips_idx) >= 2: | ||||
| for spec_v_idx in all_chains_tips_idx: | for spec_v_idx in all_chains_tips_idx: | ||||
| if (spec_v_idx not in tips_to_discard_idx): | if spec_v_idx not in tips_to_discard_idx: | ||||
| verts_tips_parsed_idx.append(spec_v_idx) | verts_tips_parsed_idx.append(spec_v_idx) | ||||
| Context not available. | |||||
| #### Check if when there are two-not-connected selections both have the same number of verts. If not terminate the script. | #### Check if when there are two-not-connected selections both have the same number of verts. If not terminate the script. | ||||
| if ((self.selection_U2_exists and len(verts_ordered_U) != len(verts_ordered_U2)) or (self.selection_V2_exists and len(verts_ordered_V) != len(verts_ordered_V2))): | if (self.selection_U2_exists and len(verts_ordered_U) != len(verts_ordered_U2)) or (self.selection_V2_exists and len(verts_ordered_V) != len(verts_ordered_V2)): | ||||
| # Display a warning. | # Display a warning. | ||||
| self.report({'WARNING'}, "Both selections must have the same number of edges") | self.report({'WARNING'}, "Both selections must have the same number of edges") | ||||
| Context not available. | |||||
| # Define verts for each face. | # Define verts for each face. | ||||
| all_surface_faces = [] | all_surface_faces = [] | ||||
| for i in range(0, len(all_surface_verts_co) - len(surface_splines_parsed[0])): | for i in range(0, len(all_surface_verts_co) - len(surface_splines_parsed[0])): | ||||
| if ((i + 1) / len(surface_splines_parsed[0]) != int((i + 1) / len(surface_splines_parsed[0]))): | if (i + 1) / len(surface_splines_parsed[0]) != int((i + 1) / len(surface_splines_parsed[0])): | ||||
| all_surface_faces.append([i+1, i , i + len(surface_splines_parsed[0]), i + len(surface_splines_parsed[0]) + 1]) | all_surface_faces.append([i+1, i , i + len(surface_splines_parsed[0]), i + len(surface_splines_parsed[0]) + 1]) | ||||
| Context not available. | |||||