def pointInTexture(self, point): inside = None if(self.get_absolute_points_not_erasable()): inside = GeoMath.pointInPoints(point, self.get_absolute_points_not_erasable()) elif(self.get_absolute_points()): inside = GeoMath.pointInPoints(point, self.get_absolute_points()) if(inside == None): if(self.get_is_default_texture()): inside = True return inside
def pointInTexture(self, point): inside = None if (self.get_absolute_points_not_erasable()): inside = GeoMath.pointInPoints( point, self.get_absolute_points_not_erasable()) elif (self.get_absolute_points()): inside = GeoMath.pointInPoints(point, self.get_absolute_points()) if (inside == None): if (self.get_is_default_texture()): inside = True return inside
def contain_bounding_box_3D(self, bounding_box): try: if (not self.get_prim()): raise Errors.CantBeNoneError( 'Prim cant be none', 'We need a prim to calculate tbn some steps after') except Errors.CantBeNoneError as e: Errors.Error.display_exception(e) exit() inside = True if (not self.get_rectangle_tangent_space()): self.convert_3D_to_2D(self.get_prim()) this_point_relative = self.get_tbn_class().get_point_which_is_relative( ) this_tbn_inverse_matrix = self.get_tbn_class().get_tbn_inverse() param_bounding_box_points_in_this_tangent_space = [] for point in bounding_box.get_points_object_space(): point_relative = GeoMath.vecSub(point, this_point_relative) point_tangent_space = this_tbn_inverse_matrix.mulPoint3ToMatrix3( point_relative) param_bounding_box_points_in_this_tangent_space.append( list(point_tangent_space)) for point in param_bounding_box_points_in_this_tangent_space: logging.debug("Rectangle tangent space" + str(self.get_rectangle_tangent_space())) inside = GeoMath.pointInPoints(point, self.get_rectangle_tangent_space()) if (not inside): break return inside
def contain_point_3D(self, point): inside = None if (not self.get_points_tangent_space()): self.create_3D_to_2D_rectangle(self.get_prim()) inside = GeoMath.pointInPoints(point, self.get_points_tangent_space()) return inside
def contain_bounding_box_3D(self, bounding_box): try: if not self.get_prim(): raise Errors.CantBeNoneError("Prim cant be none", "We need a prim to calculate tbn some steps after") except Errors.CantBeNoneError as e: Errors.Error.display_exception(e) exit() inside = True if not self.get_rectangle_tangent_space(): self.convert_3D_to_2D(self.get_prim()) this_point_relative = self.get_tbn_class().get_point_which_is_relative() this_tbn_inverse_matrix = self.get_tbn_class().get_tbn_inverse() param_bounding_box_points_in_this_tangent_space = [] for point in bounding_box.get_points_object_space(): point_relative = GeoMath.vecSub(point, this_point_relative) point_tangent_space = this_tbn_inverse_matrix.mulPoint3ToMatrix3(point_relative) param_bounding_box_points_in_this_tangent_space.append(list(point_tangent_space)) for point in param_bounding_box_points_in_this_tangent_space: logging.debug("Rectangle tangent space" + str(self.get_rectangle_tangent_space())) inside = GeoMath.pointInPoints(point, self.get_rectangle_tangent_space()) if not inside: break return inside
def contain_point_2D(self, point): return GeoMath.pointInPoints(point, self.get_points_object_space())
def contain_point_3D(self, point): inside = None if not self.get_points_tangent_space(): self.create_3D_to_2D_rectangle(self.get_prim()) inside = GeoMath.pointInPoints(point, self.get_points_tangent_space()) return inside