nortikin / sverchok

Sverchok
http://nortikin.github.io/sverchok/
GNU General Public License v3.0
2.21k stars 231 forks source link

Solid Faces operations #3403

Closed vicdoval closed 3 years ago

vicdoval commented 3 years ago

Things that can be done with Solid Faces surfaces:

Tesselate (turn to mesh a single face) image

"""
in solid_faces S .=[] .=0

out new_verts v
out new_faces s
"""

for s in solid_faces:
    raw_data = s.face.tessellate(1)
    b_verts = []
    b_faces = []
    for v in raw_data[0]:
        b_verts.append((v.x, v.y, v.z))
    for f in raw_data[1]:
        b_faces.append(f)
    new_verts.append(b_verts)
    new_faces.append(b_faces)

Extrude Surface Turn a solid face into a Solid by extrusion image

"""
in solid_faces S .=[] .=0
in dir v 
out new_verts v
out new_faces So
"""
from FreeCAD import Base
solids_out = []
for s,d in zip(solid_faces,dir):
    solid_o = s.face.extrude(Base.Vector(*d))
    solids_out.append(solid_o)

new_faces = solids_out
vicdoval commented 3 years ago

A Solid Face could be a new type of Sverchok object, or this methods could be placed into a "solid faces operations" node... Just thinking out loud

portnov commented 3 years ago

As far as I understand, it's actually a Surface + trimming Curve. "Trimmed surface" is a basic object in Grasshopper. We could extend our SvSurface class so that it would bring a trimming curve with it...

vicdoval commented 3 years ago

Yes, but it can contain holes too... i dont know if that is too much for the SvSurface class (Although it would be super cool) Also generating our own BReps from extruding our surfaces... i don't know if it is even possible... maybe we would need to transform our surface class to a FreeCAD surface... you are the expert @portnov :D

portnov commented 3 years ago

I'm afraid I do not understand the concept under "BRep" very well. Ideally, we should do something like #3385 , some kind of SvBRep... but what methods should it have?...

vicdoval commented 3 years ago

It seems quite a complex topic... https://www.opencascade.com/doc/occt-6.7.0/overview/html/occt_brep_format.html

portnov commented 3 years ago

Mostly implemented in core in #3501. Discussion about "trimmed surface" object introduction is moved to #3520.