"Make Segment" on path-curves gives wrong result #31909

Closed
opened 2012-06-23 19:51:51 +02:00 by Philipp Oeser · 5 comments
Member

%%%"Make Segment" (shortcut F) will give a new segment which appears "linear" (propably has a problem at assigning "knotsu" while making up the new spline)

I've attached two examples demonstrating this. Just open up the blend and hit "F".
This will only happen when "joining" two seperate splines (nu1 and nu2 in the code). It will succes if you do it on start and endpoint of a single spline (aka make cyclic).

The resulting wrong segment will be recalculated/corrected once it is
(1) subdivided
(2) upping the "order U" in Properties Editor > Curve Data > Active Spline, (followed by lowering it again to return to original curve-order).

I've had a go at this myself and attached a patch that of solves this by calling BKE_nurb_knot_calc_u() afterwards. While there is propably a more elegant solution (by "fixing" the loop in the code - I added a comment in the patch) I think this is still better than outputting a somewhat wrong result...%%%

%%%"Make Segment" (shortcut F) will give a new segment which appears "linear" (propably has a problem at assigning "knotsu" while making up the new spline) I've attached two examples demonstrating this. Just open up the blend and hit "F". This will only happen when "joining" two seperate splines (nu1 and nu2 in the code). It will succes if you do it on start and endpoint of a single spline (aka make cyclic). The resulting wrong segment will be recalculated/corrected once it is (1) subdivided (2) upping the "order U" in Properties Editor > Curve Data > Active Spline, (followed by lowering it again to return to original curve-order). I've had a go at this myself and attached a patch that of solves this by calling BKE_nurb_knot_calc_u() afterwards. While there is propably a more elegant solution (by "fixing" the loop in the code - I added a comment in the patch) I think this is still better than outputting a somewhat wrong result...%%%
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'

%%%Really strange no one ever noted that before… I’m quite sure it’s here for a fair amount of time!

Now I’m not much aware of NURBS, so I don’t understand what happens here. But from a quick glance at the code (BKE’s curve.c, makeknots() and calcknots()), I just find knots creation is not "simple", and can vary quite depending on flags (e.g. Bezier flag seems to change knots step…). So I highly doubt we can have a simple copy working in all cases! More over, calling BKE_nurb_knot_calc_u() does not seems much performance-critical to me (it ultimately summarizes to a single loop), imho it would be much simpler and safer to just always call it!

Btw, BKE's makeknots() creates its knots array with
MEM_callocN(4 + sizeof(float) * KNOTSU(nu), "makeknots");
Where from hell do those +4 come from???
%%%

%%%Really strange no one ever noted that before… I’m quite sure it’s here for a fair amount of time! Now I’m not much aware of NURBS, so I don’t understand what happens here. But from a quick glance at the code (BKE’s curve.c, makeknots() and calcknots()), I just find knots creation is not "simple", and can vary quite depending on flags (e.g. Bezier flag seems to change knots step…). So I highly doubt we can have a simple copy working in all cases! More over, calling BKE_nurb_knot_calc_u() does not seems much performance-critical to me (it ultimately summarizes to a single loop), imho it would be much simpler and safer to just always call it! Btw, BKE's makeknots() creates its knots array with MEM_callocN(4 + sizeof(float) * KNOTSU(nu), "makeknots"); Where from hell do those +4 come from??? %%%

%%%On the one hand cyclic shouldn't be an issue here -- here joining knots happens for two different acyclic nurbs. But on the other hand this nurbs could contain knots calculated for different order number. Would need a closer look here.%%%

%%%On the one hand cyclic shouldn't be an issue here -- here joining knots happens for two different acyclic nurbs. But on the other hand this nurbs could contain knots calculated for different order number. Would need a closer look here.%%%

%%%In fact, calculating knots seems to be easiest way until we'll support manual knots editing.

Fixed in svn rev48234. Thanks for the report, closing it now.%%%

%%%In fact, calculating knots seems to be easiest way until we'll support manual knots editing. Fixed in svn rev48234. Thanks for the report, closing it now.%%%

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' 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
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#31909
No description provided.