-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improved README and node definition example
- Loading branch information
1 parent
1d03b2b
commit 90d9c98
Showing
3 changed files
with
40 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
__pycache__/ | ||
__pycache__/ | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
class BrepPrimAPINodeBase(PythonOCCNodeBase): #The parent class of the box | ||
color = '#aabb44' #The color atributed to the parent class | ||
class BrepPrimAPINodeBase(PythonOCCNodeBase): # The parent class of the box | ||
color = '#aabb44' # The color attributed to the parent class | ||
|
||
class Box_Node(BrepPrimAPINodeBase): #explicit class name(parent class name) | ||
|
||
class Box_Node(BrepPrimAPINodeBase): # explicit class name(parent class name) | ||
""" | ||
Generates box_________- | ||
o_Width_______________- | ||
o_Length______________- #the text that will appear when your mouse will stay on the node in Ryven | ||
o_Height______________- #it indicates what inputs are expected | ||
""" | ||
init_inputs = [ | ||
NodeInputBP(dtype=dtypes.Data(size='s')), #number of inputs ollowing what your function needs | ||
NodeInputBP(dtype=dtypes.Data(size='s')), # number of inputs ollowing what your function needs | ||
NodeInputBP(dtype=dtypes.Data(size='s')), | ||
NodeInputBP(dtype=dtypes.Data(size='s')), | ||
] | ||
|
||
init_outputs = [ | ||
NodeOutputBP(), #output of the node | ||
NodeOutputBP(), # output of the node | ||
] | ||
|
||
title = 'box' #the title name of your node | ||
|
||
title = 'box' # the title name of your node | ||
|
||
def apply_op(self, elements: list): | ||
width = elements[0] #your inputs | ||
width = elements[0] # your inputs | ||
length = elements[1] | ||
height = elements[2] | ||
from OCC.Core.BRepPrimAPI import BRepPrimAPI_MakeBox #import of the method | ||
from OCC.Core.BRepPrimAPI import BRepPrimAPI_MakeBox # import of the method | ||
from OCC.Core.gp import gp_Pnt | ||
box = BRepPrimAPI_MakeBox(gp_Pnt(), width, length, height).Shape() #the function to get a result | ||
box = BRepPrimAPI_MakeBox(gp_Pnt(), width, length, height).Shape() # the function to get a result | ||
|
||
return box #the output of the node | ||
return box # the output of the node | ||
|
||
|
||
BRepPrimAPI_nodes = [ #add the node to the list if its family | ||
BRepPrimAPI_nodes = [ # add the node to the list if its family | ||
Box_Node, | ||
] | ||
|
||
|
||
export_nodes( | ||
*BRepPrimAPI_nodes, #specified the family nodes to export and to make available in Ryven | ||
) | ||
*BRepPrimAPI_nodes, # specified the family nodes to export and to make available in Ryven | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters