Page 1 of 3 123 LastLast
Results 1 to 20 of 53
  1. #1
    Member komi3D's Avatar
    Join Date
    Aug 2013
    Location
    Poland, Krakow
    Posts
    25

    [Addon] Edge Roundifier - mesh modeling tool for building arcs on selected edges

    Hi

    I created an addon that allows creating arcs from edges quickly. It is inspired by Edge Fillet and Fillet Plus addons but it works differently. You can select one or more edges and then specify radius or angle of the arc(s) that will be created. Under the hood it calculates the spin center, radius or angle and it uses the spin operator to create the arc.

    Edge roundifier maintains the original selection set after it was called. This allows to use Edge roundifier again with other settings without having to re-select edges. It can also be helpful to quickly delete original edges with X>Edges. There is also an option to merge double vertices.

    I ecourage you to use both Fillet Plus(Edge Fillet) and Edge Roundifier to get some interesting results.

    Watch the Edge Roundifier introduction video to see what is possible:


    You can download Edge Roundifier from github:
    https://github.com/komi3D/BlenderAdd...eRoundifier.py

    Note: right click on RAW button on githun site to save the script to your disk. Then open Blender and its User Preferences window. Click Install from file on the bottom of User Preferences window and choose downloaded file: EdgeRoundifier.py. Enable the addon by selecting the checkbox. You should be ready to use it. It is accessible in Edit Mode from the edge specials menu (CTRL-E) or from SPACE > Edge Roundifier.

    Current limitations of version 0.0.1 - It only works on XY plane (Z axis is used for spinning). In future versions I plan to add support for X and Y global axes as well.

    If you like please share your thoughts and ideas for improvements of this addon You can of course report any bugs you find.

    Hopefully you will find Edge Roundifier useful especially for mechanical and architectural modeling

    UPDATE 15-OCT-2014: version 0.0.2
    The main thing added is the support of 3 working planes. This allows to use the addon in FRONT, SIDE, or TOP view.
    Note that all calculations are done in LOCAL coordinate system.
    It also fixes the math domain error related to acos and cos that some of users reported.

    UPDATE 18-JUN-2015
    Version 1.0.0 is available
    please remove the old file and download the new one.
    https://github.com/komi3D/BlenderAdd..._roundifier.py
    More details about new features in this thread.

    To use the addon you can:
    1) press SPACE > type in Edge Roundifier and press enter.
    2) CTRL - E (Edge Specials menu) > Edge Roundifier
    3) Tools > Addons > EdgeWorks > Edge Roundifier


    You can get the popup window by F6.

    NOTE: Make sure to use filename mesh_edge_roundifier.py not EdgeRoundifier.py
    Last edited by komi3D; 08-Jul-15 at 16:44. Reason: clarification note added



  2. #2
    Member
    Join Date
    Jan 2014
    Location
    Dresden
    Posts
    677
    ...Genial Timesaver > Great Work...
    ...only miss: a warning message for complete selected mesh
    THX for Sharing this Tool...

    ps: is it possible to give it a rotation slider?
    Last edited by mkbreuer; 08-Sep-14 at 06:04.



  3. #3
    Member komi3D's Avatar
    Join Date
    Aug 2013
    Location
    Poland, Krakow
    Posts
    25
    Thanks
    What do you mean by 'a warning for complete selected mesh'? Could you explain? If you add a plane for example and select all edges you can still use the addon on all selected edges. It should also work when in vertex select mode (not sure about face select mode - I need to double check that).
    And about the rotation idea... Do you want to rotate each arc around the spin center and axis by specified angle? If that's what you mean, I guess I could add it in a future version. If not please explain how and what you want to rotate.
    Cheers!



  4. #4
    Member reynante's Avatar
    Join Date
    Dec 2006
    Location
    Philippines
    Posts
    1,079
    Wow, komi3D, that is nice!

    However, could you also post a more practical demonstration of this? Probably on an existing model so viewers can get a better glimpse on how this could be applicable as a modelling tool.

    Also, it would be nice to have an option whereby the reference mesh is deleted, leaving only the the contoured mesh.

    P.S.
    Can we also see a wireframe after the operation, to check if the resulting mesh is clean enough?

    Cheers!

    - Reyn



  5. #5
    Member komi3D's Avatar
    Join Date
    Aug 2013
    Location
    Poland, Krakow
    Posts
    25
    @Reyn thanks for the comment. I am currently working on preparing a short movie with examples of what can be modeled with this.
    I am planning to post it in a few days. I think I can add an option to delete the originally selected edges. If you want to see the created geometry clearer it is better to work in vertex select mode. That way you will see how many vertices are actually added to each arc.
    Cheers



  6. #6
    Member
    Join Date
    Jan 2014
    Location
    Dresden
    Posts
    677
    Hy komi3D!

    Ingnore that with the warning message if you want:
    > i selected in the first time the complete mesh and when the error pop up without a define message it slows the viewport and the menus flicker. dont understand me wrong. This is a general thing. Repeated in other addons. Maybe i can learn from your script how to do this...

    For the rotation i mean, if it possible to let a single new arc rotate around there first or active edge.
    It will be also timesaving as well...
    Last edited by mkbreuer; 09-Sep-14 at 12:50.



  7. #7
    Member komi3D's Avatar
    Join Date
    Aug 2013
    Location
    Poland, Krakow
    Posts
    25
    Originally Posted by mkbreuer View Post
    Ingnore that with the warning message if you want:
    > i selected in the first time the complete mesh and when the error pop up without a define message it slows the viewport and the menus flicker. dont understand me wrong. This is a general thing. Repeated in other addons.
    Could you write step by step what you are doing to get a warning without message? I am not sure if I understand you correctly... I only added a warning when the user sets the radius to be too small. here is the code:
    self.report({'WARNING'}, "Edge Roundifier: No centers were found. Increase radius!")
    The idea in the script is that radius needs to be more that half of length of the edge. I didn't know that warnings can slow down the viewport. If that's how it really is I can remove the warning. And for the rotation I will see what I can do. Thanks for this idea



  8. #8
    Member komi3D's Avatar
    Join Date
    Aug 2013
    Location
    Poland, Krakow
    Posts
    25
    Hello
    I am happy to share with you this new video which shows how you can use the Edge Roundifier addon to actually model a few objects.
    Here is the video:


    And here is what I model in this video:
    EdgeRoundifierExmaples_Objects.png

    Hopefully in the nearest future I will find some time to work further on this addon, fix some bugs and introduce new features.
    If you have any questions regarding this video / modeling process feel free to post it here.
    Cheers



  9. #9
    NOssaaaaaaaa perfeito... parabens!



  10. #10
    Member PKHG's Avatar
    Join Date
    Sep 2009
    Location
    NL
    Posts
    1,928
    Hi Komi3D
    The suggestion I made at youtube works, after some more experiments, e.g too with a rotated Cube (or other objects)rounding_pkhg.jpg



  11. #11
    Member komi3D's Avatar
    Join Date
    Aug 2013
    Location
    Poland, Krakow
    Posts
    25
    This is cool. I couldn't get BMesh Spin to work - I simply did not know how to use the geom parameter, so thanks for your example on youtube.
    I also harcoded the axis to be global Z. When I have some more time I will go through all your suggestions and update the script. I still have some more ideas to include in this addon. Thanks for your help



  12. #12
    Member PKHG's Avatar
    Join Date
    Sep 2009
    Location
    NL
    Posts
    1,928
    so nearly your addon new ... you may use it komi3d (add me as co?)
    Code:
    import bpy
    import bmesh
    #bmesh.ops.spin(bm, geom, cent, axis, dvec, angle, space, steps, use_duplicate)
    from math import pi, radians, degrees, sqrt 
    cu = bpy.context.scene.objects.active
    bpy.ops.object.mode_set(mode="EDIT")
    
    cud = cu.data
    
    space = cu.matrix_parent_inverse
    bm = bmesh.from_edit_mesh(cud)
    
    from mathutils import Vector
    
    def spin_one_edge(bm, edge_index = 0, steps = 4, dvec = (0,0,0), angle = 180, factor = 0):
        this_edge = bm.edges[edge_index]
        v0 = this_edge.verts[0]
        v0 = bm.verts.new(v0.co) #to not use the edge.vert itself spin bekcomes separate!
    
        v0co = v0.co
        v1 = this_edge.verts[1]
        midpoint = (v0co + v1.co) * 0.5
        loops = this_edge.link_loops
        #print("\n************** length loops",len(loops), loops[:])
    
        if len(loops) > 0:
            faces_adjacent = []
            face_normals = []
            axis = Vector()
            #for loop in loops:
            loop = loops[0]
            face = loop.face
            #faces_adjacent.append(face)
            #face_normals.append(face.normal)
            #axis += face.normal
            axis = -face.normal
        else:
            #PKHG: an othogonal vector to the edge
            eps = 0.000000000000000000000001 #PKHG>INFO a parameter?!
            direction = v1.co - v0.co
            #print(direction," \n dit is de direction")
            is_zero = [el for el in  map(lambda el: 1 if abs(el) < eps  else 0, direction)]
            nr_z = sum(is_zero)
            if nr_z == 0:
                axis = Vector((direction[0],-direction[1],0))
            else: 
                axis = is_zero
            #print("axis for ", edge_index  , " Is now" , axis)
        tmp = angle / steps
        angle = 0
        res_list = []
        for tel in range(steps + 1):
    
            result= bmesh.ops.spin(bm, geom=[v0], cent = midpoint, axis = axis, dvec = dvec,\
                                 angle = radians(angle), space = space, steps = 1, use_duplicate = True)
            #print("result is ", result['geom_last'])
    
            res_list.extend(result['geom_last'])
            #PKHG>INFO list of BMVerts
            #this list to be 'adjusted'??!! 3D triangle v0, v1 , vert[i] 
            angle  +=  tmp
        v0co = v0.co
        v1co = v1.co
    
        #PKHG>INFO first vert is always a corner point so nothing to do here
        for nr in range(1, len(res_list)):
    
            #PKHg>INFO compute the base on the edge  of the height-vector
            top = res_list[nr].co
            t = (v1co - v0co).dot(top - v0co)/(v1co - v0co).length ** 2
            h_bottom = v0co + t*(v1co-v0co)
            height = (h_bottom - top )
            #print("nr t", nr,  t, h_bottom, height.length)
            res_list[nr].co = top + factor*height
    
        for nr in range(steps):
            bm.edges.new([res_list[nr],res_list[nr + 1]])
        return res_list
    
    selected_edge_indices = [ele.index for ele in bm.edges if ele.select]
    print("\n-------- ", selected_edge_indices)
    for ii in selected_edge_indices:
        aaa = spin_one_edge(bm,edge_index = ii, angle = 360, steps = 8)
        #print(aaa)
    there may be some other ideas of selecting the axis of the a spin ... which may be worthwhile to think and eventually to implement;

    Play with it from a text window (Alt P)



  13. #13
    Member komi3D's Avatar
    Join Date
    Aug 2013
    Location
    Poland, Krakow
    Posts
    25
    @PKHG
    I want to thank you for taking your time to analyze the script and for giving this solution and ideas. I can surely add you as a co-author of this addon. No problem . I am only starting my adventure with Python for Blender so thanks for teaching me with your examples and comments on youtube. The only thing is that I currently don't have too much time to work on it. Hopefully at the beginning of October I will come back to your code, analyze it and integrate it with the addon. I also need to add all the corrections you mentioned.

    I still have some other ideas for this addon like:
    - rotating each arc around the edge (edge as rotation axis)
    - rotating each arc around its spin center (original axis rotation)
    - giving the ability to change spin axises (Global, Local and Normal X,Y and Z) - some of this is probably covered by your solution, but I want to make it as configurable by the user as possible
    - offseting the arc along line perpendicular to the originally selected edge
    - biasinig the spin center by moving it parallelly to the selected edge - this would involve calculation of the actual angle - in this case the start or end point of the selected edge would not be part of the created arc.
    - checkbox for removing original edges

    If you or anyone has some more ideas feel free to post it here!

    So please be patient We can do it together, but a little later because now I am involved in some other stuff related to Blender
    Once again thanks for your help!
    Cheers



  14. #14
    Member VickyM72's Avatar
    Join Date
    Feb 2012
    Location
    Atlanta, Georgia
    Posts
    2,039
    This is amazing, thank you!



  15. #15



  16. #16
    Member PKHG's Avatar
    Join Date
    Sep 2009
    Location
    NL
    Posts
    1,928
    Komi3D, no problem at all ...

    Rotation of arcs should be of no problem, see the stretching (above) the BMVerts are known and easy to change further ...(dependant on a menu button) ...
    See you later ... ;-)



  17. #17
    Member yii7's Avatar
    Join Date
    Sep 2012
    Location
    Turkey
    Posts
    726
    cool addon , thanks
    yiit.deviantart.com



  18. #18
    Member PKHG's Avatar
    Join Date
    Sep 2009
    Location
    NL
    Posts
    1,928
    nice game, using bmesh operaties:

    rounding_pkhg_2.jpg



  19. #19
    Member red2blue's Avatar
    Join Date
    Jul 2014
    Location
    Germany
    Posts
    27
    This addon looks really cool. Could you maybe make a slower tutorial with some explanations? It is really hard to follow in the timelaps videos. But thanks a lot for sharing this!!!



  20. #20
    Member PKHG's Avatar
    Join Date
    Sep 2009
    Location
    NL
    Posts
    1,928
    I think I will publish my ( a little bit different) addon soon (where the picture above are made with ... ), working on rotation of the bows ..

    Who can help with this problem: you have a connected string of edges and you want to rotate it with repect to the endpoints defining the rotation axis (say alpha degree rotation) ... the end points stay fixed, only the surplus vertices (edges) should be rotated ..



Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •