Use the calculation result increasing the thickness

Hi I’m learning to use RhinoVault2 and Python,
I have a question RhinoVault1 has Python syntax that can use the calculation results to increase the thickness,
But the Website Tutorial Seems to be closer to a direct offset,
I want to know Did RhinoVault2 Python has the same syntax?

hi,

could you provide a short code snippet outlining what you are trying to accomplish?

is this the tutorial you are referring to?

tom

Hi,thanks for your reply
I learned Rhino Vault1 about a year ago,I watched this video: #09 Tutorial for RhinoVAULT – Basic Scripting and Grasshopper from Block Research Group on Vimeo
and trying to complete the modeling . Each blocks has a difference in thickness .
I am currently writing a paper on digital manufacturing.
Mainly research geometry and manufacturing process.
I want to understand the difference between the two in the calculation results
I want to know this RV2 " Materialisation’’ tutorial the difference between RV1 and RV2 ?
I think the RV2 tutorial seems to be closer to a direct Normal offset .
Sorry i’m a Taiwanese student.My English is not very good, hope you can understand what I mean .

hi,

yes, in the example it is indeed a constant offset, because we first do the offset of the entire surface (with a constant value) and then “cut” this into blocks.

you could also compute individual offsets and then cut into blocks using those values to accomplish what i think you are after…

something like this
(i just wrote something here, so you might have to debug a bit…)

import random
from collections import defaultdict
from compas.geometry import Point, Vector

# other imports
# and all the usual stuff for loading the mesh data

# ...

# keep track of the offset per vertex for ever face connected to that vertex
vertex_face_offset = defaultdict(dict)

# compute the offset of each face at each vertex
# every face/block has a different offset
# i use a random value here
# but you could compute something more meaningful based on the forces in the diagram
for vertex in mesh.vertices():
    for face in mesh.vertex_faces(vertex):
        vertex_face_offset[vertex][face] = 0.1 * random.random()

# make blocks
blocks = []
for face in mesh.faces():
    bottom = []
    top = []
    
    for vertex in mesh.face_vertices(face):
        point = Point(* mesh.vertex_coordinates(vertex))
        normal = Vector(* mesh.vertex_normal(vertex))
        offset = vertex_face_offset[vertex][face]

        bottom.append(point - normal * 0.5 * offset)
        top.append(point + normal * 0.5 * offset)   

    vertices = top + bottom

    f = len(top)
    faces = []
    for i in range(len(a) - 1):
        faces.append([i, i + 1, i + 1 + f, i + f])  # the side faces
    faces.append([f - 1, 0, f, 2 * f - 1])  # the closing side face
    faces.append(list(range(f)))  # the top face
    faces.append(list(range(2 * f - 1, f - 1, -1)))  # the bottom face
    
    block = Mesh.from_vertices_and_faces(vertices, faces)
    blocks.append(block)
 

Hi! Sorry to reply to your message late,and thank you for your reply, this forum makes my study very heartwarming, I will try to use this, thank you