STL: faces not normalized correctly when exporting multiple meshes #47490

Closed
opened 2016-02-19 13:50:18 +01:00 by Matthias Urlichs · 12 comments

Blender Version
Broken: 2.74

Short description of error

STL export applies normalization inconsistently

Exact steps for others to reproduce the error

See the attached file. It consists of three objects. When exporting to STL and re-importing, one or two of these objects are inverted.

BorroPart2.blend

Other STL importers ,like the one in Slic3r, require consistent face orientation and cannot deal with that.

**Blender Version** Broken: 2.74 **Short description of error** STL export applies normalization inconsistently **Exact steps for others to reproduce the error** See the attached file. It consists of three objects. When exporting to STL and re-importing, one or two of these objects are inverted. [BorroPart2.blend](https://archive.blender.org/developer/F283922/BorroPart2.blend) Other STL importers ,like the one in Slic3r, require consistent face orientation and cannot deal with that.

Changed status to: 'Open'

Changed status to: 'Open'

Added subscriber: @MatthiasU

Added subscriber: @MatthiasU

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Campbell Barton self-assigned this 2016-02-19 17:48:47 +01:00

The models have a negative scaled axis, blender's viewport accounts for this but currently exporters dont.

Apply scale then flip normals - or remove negative scale.

We could support negative scale correction, but this is more a TODO then a bug.
If we support this, we should try support this for all exporters eventually.

The models have a negative scaled axis, blender's viewport accounts for this but currently exporters dont. Apply scale then flip normals - or remove negative scale. We could support negative scale correction, but this is more a TODO then a bug. If we support this, we should try support this for all exporters eventually.

Added subscriber: @mont29

Added subscriber: @mont29

Uh… Issue here is with negative transform matrix (i.e. when scale is negative along one or three axes), this effectively inverts the winding of faces, hence their normals.

@ideasman42 think BKE_mesh_transform() should flip faces' winding (i.e. loops) in this case? Will prepare a patch, this could be useful in other cases too (some modifiers e.g.).

Uh… Issue here is with negative transform matrix (i.e. when scale is negative along one or three axes), this effectively inverts the winding of faces, hence their normals. @ideasman42 think `BKE_mesh_transform()` should flip faces' winding (i.e. loops) in this case? Will prepare a patch, this could be useful in other cases too (some modifiers e.g.).

I just discovered that the problem also manifests when using a mirrored object in Boolean operations. "intersect" and "difference" swap their meaning and "union", fascinatingly, behaves like "reverse difference" (i.e. the result is subtracting the source from the target, not vice versa).

Please do not close this bug as "invalid". In my "real" project I need to keep some meshes linked with their mirrors for symmetry (you try to replicate a free-hand edit on both sides of a world …), thus I cannot work around the problem by applying the transform or inverting the faces.

I just discovered that the problem also manifests when using a mirrored object in Boolean operations. "intersect" and "difference" swap their meaning and "union", fascinatingly, behaves like "reverse difference" (i.e. the result is subtracting the source from the target, not vice versa). Please do not close this bug as "invalid". In my "real" project I need to keep some meshes linked with their mirrors for symmetry (you try to replicate a free-hand edit on both sides of a world …), thus I cannot work around the problem by applying the transform or inverting the faces.

@mont29: does your patch fix this?

@mont29: does your patch fix this?

@MatthiasU no, patch does not fix booleans, those are using a custom code (from Carve lib) currently. Issue is exactly the same though (transforming mesh's coordinates by object matrix, which flips the mesh in case matrix is negative). Think we can wait for final BMesh boolean code here, though, not worth spending time on carve anymore.

@MatthiasU no, patch does not fix booleans, those are using a custom code (from Carve lib) currently. Issue is exactly the same though (transforming mesh's coordinates by object matrix, which flips the mesh in case matrix is negative). Think we can wait for final BMesh boolean code here, though, not worth spending time on carve anymore.

This issue was referenced by blender/blender-addons@0f2f0e4951

This issue was referenced by blender/blender-addons@0f2f0e49517612db379f7f2958b1d1967e7e9e19

Changed status from 'Archived' to: 'Resolved'

Changed status from 'Archived' to: 'Resolved'
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
4 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#47490
No description provided.