Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(777)

Issue 12966044: Data transfer review

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 9 months ago by ideasman42
Modified:
10 years, 9 months ago
Reviewers:
eng.walidshouman
CC:
ideasman42
Base URL:
https://svn.blender.org/svnroot/bf-blender/branches/soc-2013-meshdata_transfer/
Visibility:
Public.

Description

Dat Tx Review

Patch Set 1 #

Total comments: 12
Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -0 lines) Patch
M source/blender/bmesh/tools/bmesh_data_transfer.c View 1 chunk +1 line, -0 lines 12 comments Download

Messages

Total messages: 4
ideasman42
10 years, 9 months ago (2013-08-20 06:27:00 UTC) #1
ideasman42
Checked over BM_mesh_data_copy and BM_mesh_multi_layer_copy and don't think its ready for trunk, too much unnecessary ...
10 years, 9 months ago (2013-08-20 07:01:59 UTC) #2
ideasman42
correct, correction :) https://codereview.appspot.com/12966044/diff/1/source/blender/bmesh/tools/bmesh_data_transfer.c File source/blender/bmesh/tools/bmesh_data_transfer.c (left): https://codereview.appspot.com/12966044/diff/1/source/blender/bmesh/tools/bmesh_data_transfer.c#oldcode2192 source/blender/bmesh/tools/bmesh_data_transfer.c:2192: BM_ITER_ELEM_INDEX (f_dst, &fiter, v, BM_FACES_OF_VERT, a) ...
10 years, 9 months ago (2013-08-20 07:18:19 UTC) #3
eng.walidshouman
10 years, 9 months ago (2013-08-20 19:29:06 UTC) #4
https://codereview.appspot.com/12966044/diff/1/source/blender/bmesh/tools/bme...
File source/blender/bmesh/tools/bmesh_data_transfer.c (left):

https://codereview.appspot.com/12966044/diff/1/source/blender/bmesh/tools/bme...
source/blender/bmesh/tools/bmesh_data_transfer.c:2422: //loop over the src faces
On 2013/08/20 07:02:00, ideasman42 wrote:
> This block is far too complex, apart from nested loops being problematic,
there
> just has to be a simpler way to achieve this.

/brief: this block searches for the connected faces in the source mesh, then
according to the destination loops that are connected to each source face it
makes the decision -by looking at the source face and its neighbors- whether to
weld the destination loops or not 
welding is done by adding the loops to l_grp's to be later averaged at once

getting rid of this part would make us not able to connect the faces of the same
island, the only thing I could think of for this part is to make the steps a bit
meaningful/modular

https://codereview.appspot.com/12966044/diff/1/source/blender/bmesh/tools/bme...
source/blender/bmesh/tools/bmesh_data_transfer.c:2606: const int
exp_vert_per_face = 10;
On 2013/08/20 07:02:00, ideasman42 wrote:
> Using an arbitrary size isn't needed and is a bit sloppy, the total number of
> face corners is known (bm->totloop), and the length of each face is known. You
> can allocate a single array matching the length of the total number of loops
in
> the bmesh. Then assign a segment of that array to each face, no guessing
needed.

the main usage of the exp variables -as used in line 2720- is based on not
having any clue about the variable in advance and we may need to use
malloc/realloc several times within some loops to make an online update for the
allocated memory, 
with the aid of the expected variables we could make a single offline malloc and
later expand by using realloc only if needed within the code

so its use is for speeding up the code by avoiding nested reallocations ... in
that case is there any better way to approach the speed optimisation?
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b