sketchucation logo sketchucation
    • Login
    1. Home
    2. majid
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
    Offline
    • Profile
    • Following 2
    • Followers 2
    • Topics 334
    • Posts 3,064
    • Groups 2

    majid

    @majid

    Seasoned architect, interested in sustainable design with extensive managerial, educational, archival and research and artistic experiences

    266
    Reputation
    33
    Profile views
    3.1k
    Posts
    2
    Followers
    2
    Following
    Joined
    Last Online
    Age 49
    Website www.linkedin.com/in/majid-yeganegi/
    Location Iran / Netherands

    majid Unfollow Follow
    Shop Creator registered-users

    Best posts made by majid

    • Merry Christmas !

      Merry Christmas yall!
      Playing with Blender 3D to learn better modeling and texture painting and rendering using Rayscaper!

      SketchUp_XY4IUJdVhY.jpg

      SketchUp_Tqdz3u6Zi2.jpg

      SketchUp_C5RTUb6akG.jpg

      posted in Gallery rayscaper
      majidM
      majid
    • RE: Beauties of Iran (other face of Iran)

      I do some 25*35 cm watercolors in intervals, whenever I can spare some time. Mainly focused on old Tehran (Qajar era), based on BW photos.

      Here is one of them with the details:

      6f9edd9b-2e77-479e-8675-8d9261e39db3.jpg

      07b6c876-893f-4539-ae0f-7ea97d2a30d8.jpg

      27fcdaa7-7d97-4ae1-9c95-c94d02312eff.jpg

      c5cdaafe-1828-4f03-96e7-8203c3e8a6b3.jpg e654ddcd-79db-4d1d-b43b-b9f81a4cfc86.jpg

      posted in Corner Bar
      majidM
      majid
    • Façade design!

      I know it is odd to design a facade apart from the plan/building but it has become a norm here. recently I had a facade design suggestion and here is the result.
      Changes on the 1st floor has been due to the client.
      Alt1.png !

      alt1night.png

      ax nama.jpg

      posted in Gallery
      majidM
      majid
    • RE: Beautiful Amsterdam

      Had the chance to make more...
      1.jpg 3.jpg 8.jpg

      posted in Corner Bar
      majidM
      majid
    • RE: RayScaper

      This is rather an old model... Yet I liked the result.
      ar.png

      posted in WIP
      majidM
      majid
    • RE: Beautiful Amsterdam

      And here is another shot from the Grand Hotel.
      .539e6cb9-ce68-402d-8f92-9cd2e081c725.jpg

      here is a detail from the painting.

      Old tehran- det.jpeg

      posted in Corner Bar
      majidM
      majid
    • RE: Beauties of Iran (other face of Iran)

      Meydan-e Masgh (Soldiers' drill arena), Tehran, Qajar era.
      WhatsApp Image 2025-08-05 at 7.30.36 AM.jpeg

      WhatsApp Image 2025-08-05 at 7.30.37 AM.jpeg

      WhatsApp Image 2025-08-05 at 7.30.38 AM (1).jpeg

      WhatsApp Image 2025-08-05 at 7.30.39 AM.jpeg

      posted in Corner Bar
      majidM
      majid
    • RE: Beautiful Amsterdam

      Another watercolor from the Netherlands, old Eindhoven.
      Cafe Central, TRAMHALL ( as I read)

      20251105_012404.jpg

      posted in Corner Bar
      majidM
      majid
    • RE: Atmospheric approach

      More and behind the scene images
      DES DET1.jpg DES.jpg
      des.PNG 2.jpg r.PNG Capture.PNG
      lakeside.jpg Capture.PNG

      posted in Gallery
      majidM
      majid
    • RE: RayScaper

      @pixelcruncher My pleasure to have my hands on such a charming piece of software. Considering my laptop is rather old, not supporting recent graphic cards and all the computation is done by the processor.
      Here are more tries to discover the "coating" layer .
      wew copy.jpg

      car1 copy.jpg

      posted in WIP
      majidM
      majid

    Latest posts made by majid

    • RE: Beauties of Iran (other face of Iran)

      Link Preview Image
      Fascinating photos reveal life in Iran before the revolution

      The stunning photos of life across vibrant Iran in the 60s and 70s portray a seemingly cosmopolitan kingdom on the brink of change.

      favicon

      Mail Online (www.dailymail.co.uk)

      posted in Corner Bar
      majidM
      majid
    • RE: RayScaper

      7adb4b07-7f2d-408a-87e7-1d4ecafac365-image.png
      I am preparing a decent library of metallic carpaints.

      posted in WIP
      majidM
      majid
    • RE: Rayscaper New Releases

      I have a question regarding material libraries. I have prepared a Carpaint collection and am also going to prepare a water material pack. The question is that if the same name materials will be replaced? i.e. a car paint in my library is called 001red. Imagine there is another material in the Sketchup model by user and called 001red, I am wondering if RS will replace the same name with my material? To be more precise: How do material libraries in RS work?

      posted in Extensions & Applications Discussions
      majidM
      majid
    • RE: A,B, Sketches

      @L-i-am I got a diploma in mathematics and was into algorithmic thinking. Then tried to learn architecture during university with my analytic mindset. So I see it like a procedure, not like those who do magic out of a black box. For some years, I had this chance to teach architecture, and after years, sometimes students call me to thank my way of teaching. I hope I have the chance again; this is the most satisfying job for me.

      posted in Gallery
      majidM
      majid
    • RE: SketchVault

      I appreciate it.

      posted in Developers' Forum
      majidM
      majid
    • SketchVault

      I have been developing a vault generator add-on for Blender 3D that is aimed to mimic RhinoVault (considering Blender cons/pros vs Rhino).
      It tries to find the best compression-only form for the given input mesh. Recently, I used Gemini to translate it to work with SketchUp. It is in its early stages and would be fine if anyone helps me to improve it.

      # ============================================================
      # SKETCHUP FOLDING VAULTS V4 (Robust Non-Flat Mesh + Red Anchors) | By Majid Yeganegi AI optimization -2025 Nov.
      # ============================================================
      
      require 'sketchup.rb'
      
      module VaultPlugin
      
        # --- 1. Math Helper Classes (Unchanged for performance) ---
        class SparseMatrix
          attr_reader :n_rows
          def initialize(n_rows)
            @n_rows = n_rows
            @rows = Hash.new { |h, k| h[k] = {} }
          end
          def add(r, c, val)
            return if r >= @n_rows || c >= @n_rows
            @rows[r][c] ||= 0.0
            @rows[r][c] += val
          end
          def dot(vec)
            result = Array.new(@n_rows, 0.0)
            @rows.each do |r_idx, col_data|
              sum = 0.0
              col_data.each { |c_idx, val| sum += val * vec[c_idx] }
              result[r_idx] = sum
            end
            result
          end
        end
      
        class VectorMath
          def self.sub(a, b); a.zip(b).map { |x, y| x - y }; end
          def self.add(a, b); a.zip(b).map { |x, y| x + y }; end
          def self.scale(vec, s); vec.map { |x| x * s }; end
          def self.dot(a, b); a.each_with_index.reduce(0) { |sum, (val, i)| sum + val * b[i] }; end
        end
      
        # --- 2. CG Solver ---
        def self.cg_solve(matrix, b, x0, max_iter, tol)
          x = x0.dup
          r = VectorMath.sub(b, matrix.dot(x))
          p = r.dup
          rsold = VectorMath.dot(r, r)
      
          max_iter.times do
            ap = matrix.dot(p)
            p_ap = VectorMath.dot(p, ap)
            break if p_ap.abs < 1e-15 
      
            alpha = rsold / p_ap
            x = VectorMath.add(x, VectorMath.scale(p, alpha))
            r = VectorMath.sub(r, VectorMath.scale(ap, alpha))
            rsnew = VectorMath.dot(r, r)
            break if Math.sqrt(rsnew) < tol
      
            p = VectorMath.add(r, VectorMath.scale(p, rsnew / rsold))
            rsold = rsnew
          end
          return x
        end
      
        # --- 3. Helper: Check if Material is RED ---
        def self.is_red?(entity)
          return false unless entity.material
          c = entity.material.color
          # Check for Pure Red (255, 0, 0) or close to it
          return true if c.red > 200 && c.green < 50 && c.blue < 50
          return false
        end
      
        # --- 4. Main Process ---
        def self.process_mesh(selection_mesh, density_input, load_input, scale_factor, iterations)
          model = Sketchup.active_model
          entities = model.active_entities
      
          # A. Topology Extraction
          verts = []
          v_to_id = {}
          faces = selection_mesh.grep(Sketchup::Face)
          
          if faces.empty?
            UI.messagebox("Please select a Mesh (Faces) first.")
            return
          end
      
          faces.each do |f|
            f.vertices.each do |v|
              unless v_to_id.key?(v.entityID)
                v_to_id[v.entityID] = verts.length
                verts << v
              end
            end
          end
          n = verts.length
      
          # B. Explicit Anchor Detection (THE "RED" RULE ONLY)
          anchors = []
          
          # Check 1: Red Faces
          faces.each { |f| anchors.concat(f.vertices.map { |v| v_to_id[v.entityID] }) if is_red?(f) }
      
          # Check 2: Red Edges
          edges = faces.map { |f| f.edges }.flatten.uniq
          edges.each do |e|
            if is_red?(e)
              anchors << v_to_id[e.start.entityID]
              anchors << v_to_id[e.end.entityID]
            end
          end
      
          anchors = anchors.uniq
      
          if anchors.empty?
            UI.messagebox("Error: No RED anchors found! The mesh will float freely.\nPlease paint at least one edge or face RED.")
            return
          end
      
          # C. Index Mapping
          free_map = []
          global_to_free = {}
          free_count = 0
          
          (0...n).each do |i|
            unless anchors.include?(i)
              free_map << i
              global_to_free[i] = free_count
              free_count += 1
            end
          end
          n_free = free_map.length
          
          if n_free == 0
            UI.messagebox("Error: All selected vertices are anchors. Nothing to calculate.")
            return
          end
      
          # D. Build Edges Index
          edges_idx = edges.map do |e|
            id1 = v_to_id[e.start.entityID]
            id2 = v_to_id[e.end.entityID]
            [id1, id2] if id1 && id2
          end.compact
      
          # E. TNA Setup & Matrix Assembly
          q_val = density_input 
          l_ff = SparseMatrix.new(n_free)
          d = Array.new(n, 0.0)
      
          # Build Laplacian (L_ff) and Diagonal (d)
          edges_idx.each do |u, v|
            w = q_val
            d[u] += w
            d[v] += w
            
            u_free = !anchors.include?(u)
            v_free = !anchors.include?(v)
      
            if u_free && v_free
              uf, vf = global_to_free[u], global_to_free[v]
              l_ff.add(uf, vf, -w)
              l_ff.add(vf, uf, -w)
            end
          end
      
          free_map.each { |i_glob| l_ff.add(global_to_free[i_glob], global_to_free[i_glob], d[i_glob]) }
      
          # F. Vertical Equilibrium (Solve for Final Z: Z_f)
          
          # Initial Z-positions of free nodes (used as the initial guess and for calculating Delta Z later)
          z_orig_free = Array.new(n_free)
          free_map.each_with_index { |glob_idx, i| z_orig_free[i] = verts[glob_idx].position.z }
      
          z_current = z_orig_free.dup
          
          # Iterative Solve for Z_f
          iterations.times do
            rhs = Array.new(n_free, -load_input) # -Pf
            
            edges_idx.each do |u, v|
              w = q_val
              u_free = !anchors.include?(u)
              v_free = !anchors.include?(v)
      
              # Contribution of fixed anchors to the RHS (-Lfa * Za)
              if u_free && !v_free
                rhs[global_to_free[u]] += w * verts[v].position.z 
              elsif !u_free && v_free
                rhs[global_to_free[v]] += w * verts[u].position.z
              end
            end
            
            z_current = cg_solve(l_ff, rhs, z_current, 200, 1e-5)
          end
          
          # G. Calculate and Apply Displacement (Delta Z)
          
          # Delta Z = Z_final - Z_original. This is the displacement vector.
          # It will be negative for a hanging form (since Z_f < Z_orig_f).
          delta_z = VectorMath.sub(z_current, z_orig_free)
          
          model.start_operation("Generate Vault", true)
          
          group = entities.add_group
          mesh_out = Geom::PolygonMesh.new
          
          final_pts = []
          
          # Use the sign of the scale factor to determine the flip
          # scale_factor = -5.0 means: flip the negative displacement (to positive) and scale by 5.0
          scale = scale_factor 
          
          (0...n).each do |i|
            v_orig = verts[i].position
            if anchors.include?(i)
              final_pts << v_orig # Anchors stay at their original Z
            else
              dz_calc = delta_z[global_to_free[i]]
              
              # Z_final = Z_original + (Delta Z * Scale)
              # If Delta Z is negative (hanging form) and Scale is negative (-5.0),
              # the result is positive displacement, creating the arch/vault.
              z_final = v_orig.z + (dz_calc * scale)
              
              final_pts << [v_orig.x, v_orig.y, z_final]
            end
          end
      
          # Reconstruct faces
          faces.each do |f|
            idxs = f.vertices.map { |v| v_to_id[v.entityID] }
            mesh_out.add_polygon(idxs.map { |k| final_pts[k] })
          end
          
          group.entities.add_faces_from_mesh(mesh_out)
          group.name = "Vault_Result"
          group.material = "White"
          
          group.entities.grep(Sketchup::Edge).each { |e| e.soft = true; e.smooth = true }
      
          model.commit_operation
        end
      
        # --- 5. UI Dialog ---
        def self.show_dialog
          prompts = ["Force Density (Stiffness)", "Load", "Height Scale (Multiplier)", "Iterations"]
          # Default Scale set to 5.0, as requested.
          defaults = [1.0, 1.0, 5.0, 30] 
          
          input = UI.inputbox(prompts, defaults, "TNA Settings")
          return unless input
          
          sel = Sketchup.active_model.selection
          self.process_mesh(sel, input[0], input[1], input[2], input[3])
        end
      
        unless file_loaded?(__FILE__)
          menu = UI.menu('Plugins')
          menu.add_item('Create Vault (TNA)') { self.show_dialog }
          file_loaded(__FILE__)
        end
      end
      

      SketchUp_7T40AZMCI0.png

      posted in Developers' Forum
      majidM
      majid
    • RE: A,B, Sketches

      Now let's imagine some of them as 3D objects/buildings.
      AcroRd32_5EhiY3MuQ2.png AcroRd32_5IpSVifvg6.png AcroRd32_85x4cxFJOW.png AcroRd32_ASvhpkSnEn.png AcroRd32_CmiC0gVKMQ.png AcroRd32_xMrtJ6UNZB.png AcroRd32_yjKIi3Xtbg.png

      posted in Gallery
      majidM
      majid
    • RE: A,B, Sketches

      Just imagine they could be plans/sections/facades of buildings such as houses, complexes, hospitals, hotels, etc...
      AcroRd32_r0mWXhqWnD.png AcroRd32_tRrDrfHHno.png AcroRd32_VhFXc4Pjup.png AcroRd32_VR1xBWGxXp.png AcroRd32_vy9NTt7WNv.png AcroRd32_yS1cRKbD4A.png AcroRd32_Ywf4IaTrgs.png AcroRd32_zirVhKKpPg.png AcroRd32_zLAvmKFgGv.png

      posted in Gallery
      majidM
      majid
    • RE: A,B, Sketches

      Let's continue with the letter I:
      As usual, I start from 2D sketches:
      AcroRd32_00JmGb8YdC.png AcroRd32_AohfKe5NCB.png AcroRd32_d9vJQXSgV9.png AcroRd32_diLPPJ1mYp.png AcroRd32_h5nMgkHb9I.png AcroRd32_k3rLhVKyaD.png AcroRd32_KKwhL3tD0G.png AcroRd32_KsaatXmlb6.png AcroRd32_l0Wl78YZZj.png

      posted in Gallery
      majidM
      majid
    • RE: A,B, Sketches

      The style is deliverable with the model: https://3dwarehouse.sketchup.com/model/30865223-c310-46bb-9743-46d655302747/An-H-building

      posted in Gallery
      majidM
      majid