Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing InputPoint to View#draw_line crashes SketchUp #1012

Open
Eneroth3 opened this issue Nov 14, 2024 · 3 comments
Open

Passing InputPoint to View#draw_line crashes SketchUp #1012

Eneroth3 opened this issue Nov 14, 2024 · 3 comments

Comments

@Eneroth3
Copy link

No description provided.

@Eneroth3
Copy link
Author

Expected behavior would be to throw a TypeError, possibly to implicitly convert the input point to a point3d as is done elsewhere in the API.

In any case, we shouldn't crash SketchUp.

@sketchup
Copy link

sketchup bot commented Nov 18, 2024

Logged as: SKEXT-4384

@sketchup sketchup bot added the logged label Nov 18, 2024
@Eneroth3
Copy link
Author

# Works
class Tool
  def draw(view)
    point1 = Geom::Point3d.new(0, 0, 0)
    point2 = Geom::Point3d.new(1.m, 0, 0)

    view.draw_line(point1, point2)
  end
end
Sketchup.active_model.select_tool(Tool.new)


# Crashes SketchUp
class Tool
  def draw(view)
    point1 = Geom::Point3d.new(0, 0, 0)
    point2 = Sketchup::InputPoint.new(Geom::Point3d.new(1.m, 0, 0))

    view.draw_line(point1, point2)
  end
end
Sketchup.active_model.select_tool(Tool.new)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant