"bmesh.geometry.intersect_face_point" does not always return the correct information #43739

Closed
opened 2015-02-19 22:30:22 +01:00 by Germano Cavalcante · 11 comments

System Information
Windows 64 bits

Blender Version
Broken: version 2.73 (sub 7), hash b'4ae6d58'

Short description of error
Test one point in different faces. Some face will return the value True despite the point not being in the face.

Exact steps for others to reproduce the error

  1. Open the attached .blend
  2. Copy and Paste this code (below) in Blender:
  3. See if indeed the "True" statement is really true.
    import bpy, bmesh

    obj = bpy.context.active_object
    bm = bmesh.from_edit_mesh(obj.data)

    face = bm.faces[2] #The face more to the X
    point = bm.verts[21].co #The point highlighted in red

    print(bm.faces[2])
    print(bm.verts[21])
    """..."""
    print(bmesh.geometry.intersect_face_point(face, point))

To simplify the display of indices, in the attached .blend has the script: "view3d_idx_view.py" developed by Bartius Crouch, CoDEmanX and zeffii.
bug_bmesh.blend

**System Information** Windows 64 bits **Blender Version** Broken: version 2.73 (sub 7), hash b'4ae6d58' **Short description of error** Test one point in different faces. Some face will return the value True despite the point not being in the face. **Exact steps for others to reproduce the error** 1. Open the attached .blend 2. Copy and Paste this code (below) in Blender: 3. See if indeed the "True" statement is really true. ``` import bpy, bmesh obj = bpy.context.active_object bm = bmesh.from_edit_mesh(obj.data) face = bm.faces[2] #The face more to the X point = bm.verts[21].co #The point highlighted in red print(bm.faces[2]) print(bm.verts[21]) """...""" print(bmesh.geometry.intersect_face_point(face, point)) ``` To simplify the display of indices, in the attached .blend has the script: "view3d_idx_view.py" developed by Bartius Crouch, CoDEmanX and zeffii. [bug_bmesh.blend](https://archive.blender.org/developer/F144884/bug_bmesh.blend)
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Campbell Barton was assigned by Germano Cavalcante 2015-02-19 22:30:22 +01:00
Author
Member

Added subscriber: @mano-wii

Added subscriber: @mano-wii
Campbell Barton was unassigned by Bastien Montagne 2015-02-20 10:53:31 +01:00
Bastien Montagne self-assigned this 2015-02-20 10:53:31 +01:00

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Not a bug actually, this tests the projection of the point onto the face (using face's normal)… Py doc is ambiguous here at least, though, will fix that.

Not a bug actually, this tests the **projection** of the point onto the face (using face's normal)… Py doc is ambiguous here at least, though, will fix that.

This issue was referenced by 51b0ae8a85

This issue was referenced by 51b0ae8a85dbb47963f24fe3d79de878092cc6cc

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit 51b0ae8a85.

Closed by commit 51b0ae8a85.
Author
Member

Added subscriber: @mont29

Added subscriber: @mont29
Author
Member

Okay. Thanks for the clarification @mont29. But confirms if I really understood. What is happening is what is represented in this image?:
Do_be_that_way.png

Okay. Thanks for the clarification @mont29. But confirms if I really understood. What is happening is what is represented in this image?: ![Do_be_that_way.png](https://archive.blender.org/developer/F144964/Do_be_that_way.png)

Yes, that’s expected behavior (potential float precision issues taken into account, so in limit cases you may have 'surprises').

Yes, that’s expected behavior (potential float precision issues taken into account, so in limit cases you may have 'surprises').
Author
Member

I Got. If the accretion option "projection distance" not much increase the calculation memory. I think it would be a good consideration.
Ex: bmesh.geometry.intersect_face_point (face, point, projection_distance).
Just a idea.

I Got. If the accretion option "projection distance" not much increase the calculation memory. I think it would be a good consideration. Ex: bmesh.geometry.intersect_face_point (face, point, projection_distance). Just a idea.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
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
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#43739
No description provided.