ray_cast face index with n_gons #36363
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#36363
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
%%%--- Operating System, Graphics card ---
Windows 7 64.
Current build 58838
I have experienced this for a while (5 months?) but just worked around it until I thought it might be proactive to mention it
When using the object.ray_cast() method, if the object has ngons, and the ray intersects the n_gon, the ray_cast
function returns the face_index of the TRIANGULATED n_gon, resulting in face indices that do not exist in in the mesh.
This is troublesome for me, because I'm developing some tools which raycast the users interaction onto the object.
My workaround is to create a temporary object and triangulate it.
Open blender default scene
Add a cylinder primitive with ngon caps
in the python console type the following:
from mathutils import Vector
C.object.ray_cast(Vector((0,0,0)),Vector((0,0,2)))
Notice it returns 45 as the face index but there are only 34 faces in the cylinder primitive.
%%%
Changed status to: 'Open'
%%%fixed r58950.%%%
Changed status from 'Open' to: 'Resolved'
%%%Thanks!%%%