CAD LOGIC SS 08/09 Slitting / documentation AA’ : Alice + Alec’

I) Exploration Pre-Phase

CAD LOGIC SS 08/09 Slitting / documentation

AAâ€™

Slit #003

Slit #003

Slit #003

Slit #014

Slit #011 Slit #005

Slit #006

Slit #006

Slit #006

Slit #007

Slit #008

Elipse - 80 Slits offset centre (1)

Slit #008

Slit #008

Slit #009

Slit #009

Slit #009

Slit #010

Elipse - 80 Slits offset centre (2)

Shape, position, center of the cut

Shape, position, center of the cut

Center of the cut

Slit #007

Slit #011

Elipse - 80 Slits offset centre (3)

Slit #004

Slit #012

Leaf shape - 80 Slits

Slit #005

Slit #006

Elipse - 80 Slits linear centre

Slit #006

Random length (1) - 40 Slits

Slit #007

Slit #004

Slit #007

Slit #005

Slit #008

Slit #005

Slit #008

Slit #006

Slit #009

Slit #006

Slit #007

Slit #007

Slit #013

Slit #014

Slit #015

Slit #016

Slit #017

Slit #018

Slit #008

Slit #008

Slit #009

Elipse (1/4) - 20 Slits

Slit #012

Slit #004

Random length (2) - 40 Slits

Slit #015

Shape, position, center of the cut

Slit #007

Lenght of the cut

Nb of cuts

Nb of cuts

Slit #003

Slit #018

Shape, position, center of the cut

Slit #003

Elipse - 80 Slits

Center of the cut

Slit #002

Lenght of the cut

Slit #002

Circle - 40 slits

Slit #011

Slit #001

Slit #010

Slit #001

Slit #003

Slit #014

Slit #005

Slit #003

Slit #013

Slit #004

Slit #002

Slit #017

Slit #002

Slit #016

Slit #001

Slit #010

Slit #001

Slit Slit #016 #002

Slit #005

Slit #001

Slit #005

Slit #013

Slit #004

Variations/Declination

Slit #004

Nb of cuts

Slit #004

Center of the cut Slit Slit #017 #003

Lenght of the cut

Variations/Declination Variations/Declination

Circle - 20 slits

Slit #018

Slit #015

Variations/Declination Variations/Declination

Slit #006

Slit #002

Slit #005

Slit #002

Slit #004

Slit #002

Nb of cuts

Nb of cuts

Nb of cuts

Slit #001

Shape, position, center of the cut

Shape, position, center of the cut

Slit #001

Nb of cuts

Shape, position, center of the cut

Slit #001

Shape, position, center of the cut

Nb of cuts

Slit #012

Variations/Declination Variations/Declination Variations/Declination Phase 1 - Slit A This series of slitting experiment demonstrates the quality of fuzziness and unexpected chaotic condition by stretching or banding the paper with slits converging to a points; whereas the structural behavior of the paper itself is apparently weakened by the slits

Slit #009

Slit #009

CAD LOGIC SS 08/09 Slitting / documentation

AAâ€™

Phase 1 - Slit Bi Apart from Slit A, Slit B is the first attempt to explore this specific way of shifting slits. Comparatively, Slit B series has more parameters to control the final result which allows for wider varieties. The Slitting does not weaken so much the structural property of the paper but still being very stretchable, contractable and flexible. HYBRID 1

slit 5 - 35mm (gradual) interval 2.5/5mm (constant) gap 2.5mm (constant) ratio of slit to interval (varied) ratio of slit to gap (varied) pattern_linear slit & wavy interval

HYBRID 2

slit (gradual) interval 5mm (constant) gap 2.5mm (constant) ratio of slit to interval (varied) ratio of slit to gap (varied) pattern_circular slit & radial interval

HYBRID 3

slit (gradual) interval (gradual) gap (gradual) ratio of slit to interval (varied) ratio of slit to gap (varied) pattern_curvy radial slit and interval

CAD LOGIC SS 08/09 Slitting / documentation

AAâ€™

Phase II - Slit Biia & iv This series of slitting experiment creates just slight or no degree of deformation to the paper. This proves that the radial pattern is not suitable for slitting method

CAD LOGIC SS 08/09 Slitting / documentation

AAâ€™

Phase II - Slit Biii

HYBRID 5

slit (gradual) interval 5mm (constant) gap 2.5mm (constant) ratio of slit to interval (varied) ratio of slit to gap (varied) pattern_circular slit & interval

CAD LOGIC SS 08/09 Slitting / documentation

AAâ€™

Phase II - Slit Biib & iv This series of slitting experiment creates spatial volume easily, but rather too centre-oriented. It becomes more interesting when pushing force is not parallel to the normal of the material plane. Ellipse shape may also help to break the symmetry.

CIRCULAR 1 slit (gradual) interval (gradual) gap 2.5mm (constant) ratio of slit to interval (varied) ratio of slit to gap (varied) pattern_circular slit & radial interval

CAD LOGIC SS 08/09 Slitting / documentation

AAâ€™

CIRCULAR 2 slit (gradual) interval (gradual) gap 2.5mm (constant) ratio of slit to interval (varied) ratio of slit to gap (varied) pattern_rectangular slit & radial interval

CAD LOGIC SS 08/09 Slitting / documentation

AAâ€™

COMBINED 3 slit (gradual) interval (gradual) gap 2.5mm (constant) ratio of slit to interval (varied) ratio of slit to gap (varied) pattern_circular slit & radial interval

CAD LOGIC SS 08/09 Slitting / documentation

AAâ€™

COMBINED 2 slit (gradual) interval (gradual) gap 5mm (constant) ratio of slit to interval (varied) ratio of slit to gap (varied) pattern_rectangular slit & radial interval

CAD LOGIC SS 08/09 Slitting / documentation

AAâ€™

SURFACE DEFORMATION CAD_LogicDD : Alice & Alec’ summary of investigation

Material Properties

*contractable *stretchable *flexible PHASE I - Slit A

PHASE II - Slit Biia & iv

This series of slitting experiment demonstrates the quality of fuzziness and unexpected chaotic condition my stretching or banding the paper with slits converging to a points; whereas the structural behavior of the paper itself is apparently weakened by the slits

This series of slitting experiment creates just slight or no degree of deformation to the paper. This proves that the radial pattern is not suitable for slitting in alternate interval

- with certain stiffness

PHASE II - Slit Biib & iv

COMBINED 1 slit 15mm (constant) interval 10mm (constant) gap (gradual) ratio of slit to interval 1.5 ratio of slit to gap (varied) pattern_radial slit & circular interval

This series of slitting experiment creates spatial volume easily, but rather too central oriented. It becomes more interesting when pushing force is not parallel to the normal of the material plane. Ellipse shape may help to break the symmetry.

SLIT A. Slits converging toward a point

CIRCULAR 1 slit (gradual) interval (gradual) gap 2.5mm (constant) ratio of slit to interval (varied) ratio of slit to gap (varied) pattern_circular slit & radial interval

Potentials

- fuzzy effect - unexpected / unpredictable quality

Parameter

- length of slits (constant : gradual) - location of centre (centred, offset, at the edge, out of the edge) - density of slits Variable Factor - application of stress (direction)

CIRCLE 1 20 Slits constant length

CIRCLE 2 40 Slits constant length

CIRCLE 3 80 Slits constant length

CIRCULAR 2 slit (gradual) interval (gradual) gap 2.5mm (constant) ratio of slit to interval (varied) ratio of slit to gap (varied) pattern_rectangular slit & radial interval

SLIT B. Slits in alternate interval i. linear iia. radial - linear form iib. radial - circular form iv. hybrid iii. combined

Potentials

- stretchable curvilinear surface - full of varieties

Parameter

- length of slits (constant : gradual) - length of intervals (constant : gradual) - width of gap in between 2 lines of slits (constant) - ratio of length of slit to length of interval - ratio of length of slit to width of gap - location of centre - density of slits - pattern of slits in relation to pattern of intervals

ELIPSE 1

80 Slits centred centre gradual change of length

ELIPSE 2

80 Slits offset centre gradual change of length

ELIPSE 3 (1)

30 Slits centre at the edge gradual change of length

COMBINED 2 slit (gradual) interval (gradual) gap 5mm (constant) ratio of slit to interval (varied) ratio of slit to gap (varied) pattern_rectangular slit & radial interval

Variable factor - application of stress (direction)

ELIPSE 3 (2)

30 Slits centre at the edge gradual change of length

ELIPSE 3 (3)

ELIPSE 4

LEAF 1

ELIPSE 5

40 Slits centre at the edge gradual change of length

18 Slits centre out of the edge gradual change of length

ELIPSE 6 (1/4)

20 Slits centre at the edge of the material gradual change of length

80 Slits offset centre gradual change of length

80 Slits linear centre gradual change of length

CIRCULAR 3 slit (gradual) interval (gradual) gap (gradual) ratio of slit to interval (varied) ratio of slit to gap (varied) pattern_circular slit & radial interval

Star 1

40 Slits centred centre random length

STAR 2

40 Slits centre at the edge both gradual and random change of length

Star 3

80 Slits offset centre both gradual and random change of length

PHASE I - Slit Bi Apart from Slit A, Slit Bi is the first attempt to explore this specific way of slitting in every alternative interval. Comparatively, Slit B series has more parameters to control the final result which allows for wider varieties. The slitting doesn’t weaken so much the structural property of the paper but still being very stretchable, contractable and flexible

COMBINED 3 slit (gradual) interval (gradual) gap 2.5mm (constant) ratio of slit to interval (varied) ratio of slit to gap (varied) pattern_circular slit & radial interval LINEAR 1

slit 10mm (constant) interval 5mm (constant) gap 2.5mm (constant) ratio of slit to interval 2 ratio of slit to gap 4 pattern_regular linear

LINEAR 2

slit 20mm (constant) interval 5mm (constant) gap 2.5mm (constant) ratio of slit to interval 4 ratio of slit to gap 8 pattern_regular linear

LINEAR 3

slit 30 mm (constant) interval 5mm (constant) gap 2.5mm (constant) ratio of slit to interval 6 ratio of slit to gap 12 pattern_regular linear

LINEAR 4

slit 5 - 35mm (gradual) interval 2.5/5mm (constant) gap 2.5mm (constant) ratio of slit to interval (varied) ratio of slit to gap (varied) pattern_chaning linear

HYBRID 4

slit (gradual) interval 2.5mm (constant) gap (gradual) ratio of slit to interval (varied) ratio of slit to gap (varied) pattern_linear to curve slit & regular linear interval

PHASE I - Slit Biii

HYBRID 5

slit (gradual) interval 5mm (constant) gap 2.5mm (constant) ratio of slit to interval (varied) ratio of slit to gap (varied) pattern_circular slit & interval

HYBRID 1

slit 5 - 35mm (gradual) interval 2.5/5mm (constant) gap 2.5mm (constant) ratio of slit to interval (varied) ratio of slit to gap (varied) pattern_linear slit & wavy interval

HYBRID 2

slit (gradual) interval 5mm (constant) gap 2.5mm (constant) ratio of slit to interval (varied) ratio of slit to gap (varied) pattern_circular slit & radial interval

HYBRID 3

slit (gradual) interval (gradual) gap (gradual) ratio of slit to interval (varied) ratio of slit to gap (varied) pattern_curvy radial slit and interval

CAD LOGIC SS 08/09 Slitting / documentation

AA’

SURFACE DEFORMATION CAD_LogicDD : Alice & Alec’ summary of investigation

*contractable *stretchable *flexible PHASE I - Slit A

PHASE II - Slit Biia & iv

PHASE II - Slit Biib & iv This series of slitting experiment creates spatial volume easily, but rather too central oriented. It becomes more interesting when pushing force is not parallel to the normal of the material plane. Ellipse shape may help to break the symmetry.

This series of slitting experiment demonstrates the quality of fuzziness and unexpected chaotic condition my stretching or banding the paper with slits converging to a points; whereas the structural behavior of the paper itself is apparently weakened by the slits

PHASE I - Slit Bi Apart from Slit A, Slit Bi is the first attempt to explore this specific way of slitting in every alternative interval. Comparatively, Slit B series has more parameters to control the final result which allows for wider varieties. The slitting doesn’t weaken so much the structural property of the paper but still being very stretchable, contractable and flexible

PHASE I - Slit Biii

CAD LOGIC SS 08/09 Slitting / documentation

AA’

II) Analysis of the model translated into the digital realm

[Quinconce] Through previous experiments, we focus at the end on this type of shifted straight cuts. We obverse that it could be adjusted by numerous parameters, including length of slits, density of slits, pattern of slits and variable factors - magnitude and direction of applied forces. Therefore, the slitting method creates an intricate network which is flexible enough that, from time to time, even one single pattern can always result into series of forms and shapes. In order to analyze the basic deformation princple of the slitting itself, we zoom in and look at the typical condition before/after stretch. Interestingly enough, we find that the shifted slits induce a series of nodes which are linked to 4 other nodes. A surface is transformed into a quadrilateral lattice network. [Quinconce], a french word, describes exactly the geometric relationship consisting of five points, four of them forming a square or rectangle and a fifth at its center.

CAD LOGIC SS 08/09 Slitting / documentation

AAâ€™

before stretch

/ series of typical slits

CAD LOGIC SS 08/09 Slitting / documentation

AAâ€™

before stretch

/ series of nodes in between the slits

CAD LOGIC SS 08/09 Slitting / documentation

AAâ€™

before stretch

/ each node has 4 Linkages which form a Quinconce quadilateral lattice network

L

CAD LOGIC SS 08/09 Slitting / documentation

AAâ€™

after stretch

/ location of the nodes are displaced, but length of the linkages remains constant

elongated

L

shortened

CAD LOGIC SS 08/09 Slitting / documentation

AAâ€™

III) Strategy of the digital model In general, there are two possibilities for the strategy of our digital model, “manufacture-oriented” & “new form searching”

Strategy 1 : Manufacture-oriented Assuming there is a piece of object with 3D curvilinear surface and how we can use the same slitting prinicple and “reproduce” a slitting pattern on a 2D surface. Therefore, one can easily apply the technique to many different objects and generate 2D pattern for manufacturing. However, in this case, a key characteristic of our slitting method is being ignored - Flexibility of the intricate lattice network. In our analysis of the basic principle, we have explained that the relationship between the slitting pattern and deformation result is not 1 to 1 linear process because of many parameters and the variable factor - applied force. For any pattern applying the same principle, owning to the magitude and direction of the applied force, the paper will deform into different shapes. Without accurate mathematical calculation and take all the factors into account, it is not possible to reverse the process from 3D to 2D. Over simpfying or ignoring some factors would take away the complexity of the slitting method.

Strategy 2 : New-form Searching We turn our direction to see how we can demonstrate the behavior of a surface by perceiving it as a Quinconce lattice network in a digital format. By scripting, we can easily set up parameters for making different lattice network. Then, we can test out various possibilities on one single pattern. In this way, instead of simply translating any of our physical models into digital realm in a represenatational way, we actually create a flexible lattice system which can be manipulated by adjusting various parameters in order to come up with a new desirable form, meanwhile there is a conherent logic behind the form that could be manufactured by using 2D material. In another word, it is a back-and-froth design process. CAD LOGIC SS 08/09 Slitting / documentation

AA’

IV) Explanation of the script and logic The critical part of the principle of the deformation is that displacement of the nodes in any direction would not affect length of the linkage. Therefore, when we develop our script, we imagine a sphere, which represents the track for the linked surrounding nodes, is attached on to the centre of each node. When one node, N0, is moved, let say from original position to a new position, nP0, surrounding nodes will follow. Without other circumstances, we take the assumption that the surrounding nodes will be displaced by the shortest distance. If we create the curve linking the original position of a surrounding node to nP0. Then, we can locate the new position of the surrounding node as the intersection point of the curve and the sphere of the node N0.

Diagram illustrates the logic of the script / before deformation

Step 1

Step 2

Step 3

create primary nodes (black) & secondary nodes (grey), base on a certain slitting pattern

attach spheres to the centre of each nodes which link up the 4 surrounding points. The spheres represent tracks for linked surrounding nodes

build up the connections for visualizing the network. The length of the connections should always remain constant

CAD LOGIC SS 08/09 Slitting / documentation

AAâ€™

Diagram illustrates the logic of the script / during deformation

A row of nodes on 2D plane before deformation

When deformation occurs and a node is moved in z direction, other nodes will follow and move to the new positions base on the logic that length of linkage remains constant all the time. Section view

CAD LOGIC SS 08/09 Slitting / documentation

AAâ€™

V) Finished script and images of the digital model At this moment, the finished script allows us to test out simple and even slitting patterns. We can choose to move any node to different directions and execute the deformation. Since this is an abstract model which using quinconce lattice network as a basic principle for deformation and some physical properties of material have to be excluded, therefore the performance of the deformation done by the script is still is not a real simulation. Nevertheless, given more time, the script can be further enhanced and be more comprehensive, so that we can test with more complex patterns, e.g. different lengths and densities of slits, with the same slitting principle.

For demonstration, we use a basic 50 X 10 grid

Step 1 [Create Surface with U>=V] define the numbers of divisions in X and Y axis; and setup the basic grid for locating the the primary nodes

CAD LOGIC SS 08/09 Slitting / documentation

AAâ€™

Step 2 [Init Scene()] create the lattice network composed of primary nodes and secondary nodes marked by locators

CAD LOGIC SS 08/09 Slitting / documentation

AAâ€™

For demonstration, we select the middle node of the grid

Step 3 [Choose Locator to offset] select desired locator(s) to be moved; they will be the control nodes for deformation

CAD LOGIC SS 08/09 Slitting / documentation

AAâ€™

Step 4 [Calculate Distances] taking selected locators as reference, calculation of the distances among the nodes will be done

CAD LOGIC SS 08/09 Slitting / documentation

AAâ€™

Step 5 before moving the selected locators, there are options to continue; to change parameter or to use default parameter setting

CAD LOGIC SS 08/09 Slitting / documentation

AAâ€™

Step 6 [Execute Quinconce Function()] a new dialogue box will appear for adjusting the distances for moving each selected locators in x, y, z directions Step 7 [Execute Wireframe Function()] an extensive option is to build a wireframe on the quinconce network to visualize the actual slitting pattern. However, the result is not properly resolved yet.

CAD LOGIC SS 08/09 Slitting / documentation

AAâ€™

Other trials In order to experiment with the digital model, we tested out different push and pull on the same slitting pattern. On one hand, the script is very successful in deforming a surface base of the quinconce logic and all the linkages between nodes remain constant before/after. On the other hand, when there are more than one nodes being moved, the distance calculation among the nodes becomes very complicated for the redisturbution of all the nodes. Unavoidably errors may happen.

CAD LOGIC SS 08/09 Slitting / documentation

AAâ€™

Ful

l Sc

rip

t

import maya.cmds as cmds # Function to lauch the window def initparameters(): # Create a scene with the default parameters # udiv = vdiv = 3, pointtooffsept = SecondPoint_4 def defaultparam(*arg): cmds.select(all=True) cmds.delete() createSurface() cmds.showHidden(‘surface’) initscene() if cmds.objExists(“SecondPoint_4”): cmds.select(“SecondPoint_4”) controlepoints() # Create the first surface def createSurface(udiv=3, vdiv=3): if cmds.objExists(‘surface’): cmds.delete(“surface”) surface = cmds.polyPlane(ax=(0,0,1), w=50,h=50, sx=int(vdiv), sy=int(vdiv), n=”surface”) # Add attributes to the surface cmds.select(“surface”) cmds.addAttr(ln=”udivision”, dt=”double2”, keyable=1, w=1) cmds.setAttr(“surface.udivision”, 3, 3, type=”double2”) cmds.addAttr(ln=”vdivision”, dt=”double2”, keyable=1, w=1) cmds.setAttr(“surface.vdivision”, 3, 3, type=”double2”) # Change the number of udiv.& vdiv def changeDiv(*args): udiv = cmds.getAttr(“surface.udivision”) vdiv = cmds.getAttr(“surface.vdivision”) if cmds.objExists(‘surface’): cmds.delete(“surface”) surface = cmds.polyPlane(ax=(0,0,1), w=50,h=50, sx=udiv, sy=vdiv, n=”surface”) # Add attributes to the surface cmds.select(“surface”) cmds.addAttr(ln=”udivision”, dt=”double2”, keyable=1, w=1)

cmds.setAttr(“surface.udivision”, udiv, udiv, type=”double2”) cmds.addAttr(ln=”vdivision”, dt=”double2”, keyable=1, w=1) cmds.setAttr(“surface.vdivision”, vdiv, vdiv, type=”double2”) # Hide the surface to choose the controle points = pressure points def ChoosePoints(*args): cmds.hide(‘surface’) # Second Window ::: Adjust Forces ::: def tocontinue(*args): forces = cmds.window(title=”Adjust Forces”, width=600, height=400) cmds.columnLayout( adjustableColumn=True ) cmds.button(“movelocator”, label=’Move Locator’) nbpoints = cmds.getAttr(‘surface.nbpoints’) Pointtooffset = [] loc = [] for i in range (int(nbpoints)): point = cmds.getAttr(‘surface.pointtooffset%s’ %i) loc.append(point) # Create a first slider to control all the locator position ::: Doesn’t works yet. :-) Offx = cmds.floatSliderButtonGrp(‘Offx’, label=’Uniform X Offset’, field=True, min=-50, max=50, v=0) Offy = cmds.floatSliderButtonGrp(‘Offy’, label=’Uniform Y Offset’, field=True, min=-50, max=50, v=0) Offz = cmds.floatSliderButtonGrp(‘Offz’, label=’Uniform Z Offset’, field=True, min=-50, max=50, v=0) for i in range(int(nbpoints)): cmds.connectControl(‘Offx’, “%s.translateX” %loc[i]) cmds.connectControl(‘Offy’, “%s.translateY” %loc[i]) cmds.connectControl(‘Offz’, “%s.translateZ” %loc[i]) # Create a slider for each other locator for i in range(int(nbpoints)): offx = cmds.floatSliderButtonGrp(‘offx%s’%i, label=’Offset X_%s’ %i, field=True, min=-50, max=50, v=0) cmds.connectControl(‘offx%s’%i, “%s.translateX” %loc[i]) offy = cmds.floatSliderButtonGrp(‘offy%s’%i, label=’Offset Y_%s’ %i, field=True, min=-50, max=50, v=0) cmds.connectControl(‘offy%s’%i, “%s.translateY” %loc[i]) offz = cmds.floatSliderButtonGrp(‘offz%s’%i, label=’Offset Z_%s’ %i, field=True, min=-50, max=50, v=0) cmds.connectControl(‘offz%s’%i, “%s.translateZ” %loc[i])

CAD LOGIC SS 08/09 Slitting / documentation

AA’

cmds.button(“Quinconce”, label=’Execute Quinconce Function()’, command=Quinconce ) cmds.button(“Wireframe”, label=’Execute Wireframe Function()’, command=makeWireframe ) cmds.showWindow(forces) # Re-Set the parameters def back(*arg): cmds.select(all=True) cmds.delete() initparameters() # Make a wireframe to simulate the paper stripes def makeWireframe(*arg): cmds.select(“surface”) numFaces= cmds.polyEvaluate(face=True) w = cmds.getAttr(“surface.vdivision”) w = 50/(w[0][1]*4) #loop through all the faces of the objects and extrude one by one for i in range(0, numFaces, 1): currentFace=”%s.f[%d]” % (“surface”,i) cmds.polyExtrudeFacet(currentFace,offset=w) #cmds.refresh() #delete all the original faces of the objects allOriginalFaces= “%s.f[0:%d]” % (“surface”,numFaces-1) cmds.polyDelFacet(allOriginalFaces) # Give a thickness to the paper #newNumFaces= cmds.polyEvaluate(face=True) #allNewFaces= “%s.f[0:%d]” % (“surface”, newNumFaces-1) #cmds.polyExtrudeFacet(allNewFaces,kft=True) # Create the first window ::: Adjust Surface Parameters ::: createSurface() cmds.hide(‘surface’) param = cmds.window(title=”Adjust Surface Parameters”, width=600, height=400) cmds.columnLayout( adjustableColumn=True ) cmds.button(label=’’, en=False , bgc=[225,0,0]) cmds.button(“surface”, label=’Create Surface with U >= V’, en=False)

udiv = cmds.floatSliderButtonGrp(‘udiv’, label=’Nb of U Divisions’, field=True, min=1, max=100, v=0, s=1.0, pre=0 ) vdiv = cmds.floatSliderButtonGrp(‘vdiv’, label=’Nb of V Divisions’, field=True, min=2, max=300, v=0, s=1.0, pre=0 ) cmds.connectControl(‘udiv’, “surface.udivision”) cmds.connectControl(‘vdiv’, “surface.vdivision”) cmds.button(“div”, label=’Press Here to Create the Surface’, command=changeDiv ) cmds.button(“init”, label=’Init Scene()’, command=initscene ) cmds.button(label=’Choose Locator to offset’, command=ChoosePoints ) cmds.button(label=’Calculate Distances’, command=controlepoints ) cmds.button(label=’’, en=False, bgc=[225,0,0]) cmds.button(label=’### next ###’, en=False) cmds.button(label=’To Continue’, command=tocontinue ) cmds.button(label=’Change Parameters before to continue’, command=back ) cmds.button(label=’Use Default Parameters’, command=defaultparam ) cmds.showWindow(param) # Initialize the scene # Step 01: Get the Primary Points = The vertices of the surface. # Step 02: Get the Secondary Points = Vertices of the surface after a subdivision # Step 03: Delete the non-cuts edges! def initscene(*args): # Clean Scene cmds.select(all=True) if cmds.objExists(‘surface’): cmds.select(“surface”, d=True) cmds.delete() # Create groupe to store the locators cmds.group(n=’PrimPoints’, em=1) cmds.group(n=’SecondPoints’, em=1) # Get the number of faces, the number of vertices and the number of divisions nbfaces = cmds.polyEvaluate(“surface”, f=True ) nbvertex = cmds.polyEvaluate(“surface”, v=True ) udiv = cmds.getAttr(“surface.udivision”) udiv = int(udiv[0][0]) vdiv = cmds.getAttr(“surface.vdivision”) vdiv = int(vdiv[0][0])

############################################ # STEP01 # Get the Primary points # Create a locator in each point location ############################################

CAD LOGIC SS 08/09 Slitting / documentation

AA’

PrimPoints = [] PrimVtx = [] for i in range(0,nbvertex,1): # Create locator in each vertex position nvtx = “%s.vtx[%i]” %(“surface”, i) pos = cmds.pointPosition(nvtx) nloc = “PrimPoint_%i” %i loc = cmds.spaceLocator(p=pos, n=nloc) cmds.parent(loc, “PrimPoints”) cmds.addAttr(ln=”distanceto%s”%loc[0], dt=”string”, keyable=1, w=1) # Add the name of the corresponding vertex in the locator’s attributes cmds.select(loc[0]) cmds.addAttr(ln=”vertex”, dt=”string”, keyable=1, w=1) cmds.setAttr(loc[0] + “.vertex”, nvtx, type=”string”) # By default is not a border cmds.addAttr(ln=”border”, dt=”string”, keyable=1, w=1) cmds.setAttr(loc[0] + “.border”, ‘False’, type=”string”) # Fill the lists.. # SecondPoints == Name of the vertex with its corresponding locator # inputList = (nvtx, “PrimPoint_%i” %i) PrimPoints.append(“PrimPoint_%i” %i) PrimVtx.append(nvtx) # Set the original edges (except the borders) to delete, # in order to remain only the “connexions” edgestodelete = [] for i in range(0,nbfaces,1): # Get the points nf = “%s.f[%i]” %(“surface”, i) cmds.select(nf) face = cmds.ls(sl=True) points = cmds.polyListComponentConversion(face, ff=1, tv=1) # Delete the useless edge to remain only the “cuts” edges = cmds.polyListComponentConversion(face, ff=1, te=1) edgestodelete.append(edges) # Get the points name cmds.select(points) points = cmds.ls(sl=True, fl=1) ################################################# # STEP02: # Get the secondary points # Sudbivide each face to get the secondary cuts #################################################

cmds.polyPoke(“%s.f[0:%s]” %(“surface”, nbfaces)) newvertex = cmds.polyEvaluate(“surface”, v=True ) # For each new vertex SecondPoints = [] SecondVtx = [] bordervtx = [] # For each new vertex created = Secondary points for i in range(nbvertex,newvertex,1): # Get the name of the new vertices created nvtx = “%s.vtx[%i]” %(“surface”, i) # Create a Locator on the position of the Secondary Points pos = cmds.pointPosition(nvtx) nloc = “SecondPoint_%i” %(i-nbvertex) loc = cmds.spaceLocator(p=pos, n=nloc) cmds.parent(loc, “SecondPoints”) # Add the name of the corresponding vertex in the locator’s attribut cmds.select(loc[0]) cmds.addAttr(ln=”vertex”, dt=”string”, keyable=1, w=1) cmds.setAttr(loc[0] + “.vertex”, nvtx, type=”string”) # By default is not a border cmds.addAttr(ln=”border”, dt=”string”, keyable=1, w=1) cmds.setAttr(loc[0] + “.border”, ‘False’, type=”string”) # Fill the lists.. # SecondPoints == Name of the vertex with its corresponding locator SecondPoints.append(nloc) SecondVtx.append(nvtx) # Save informations in the surface attr. # Add nb of Primary & Secondary Points in the surface attr cmds.select(‘surface’) cmds.addAttr(ln=”nbPrim”, dt=”string”, keyable=1, w=1) cmds.setAttr(“surface.nbPrim”, len(PrimPoints), type=”string”) cmds.addAttr(ln=”nbSecond”, dt=”string”, keyable=1, w=1) cmds.setAttr(“surface.nbSecond”, len(SecondPoints), type=”string”)

######################################## # STEP03: # Delete the non-cuts edges! ######################################## # Define the borders of the surface ... # ... From the sides of the surface

CAD LOGIC SS 08/09 Slitting / documentation

AA’

for i in range(0, nbvertex, udiv+1): bordervtx.append(“surface.vtx[%i]” % i) bordervtx.append(“surface.vtx[%i]” % (i+udiv)) # ... From the first row. for i in range(1, udiv, 1): bordervtx.append(“surface.vtx[%i]” % i) # ... From the last row start = ((udiv * vdiv)+vdiv+1) for i in range(start, nbvertex-1, 1): bordervtx.append(“surface.vtx[%i]” % i) # Select Vertices border for i in (bordervtx): index = PrimVtx.index(i) nloc = PrimPoints[index] cmds.select(nloc) #cmds.addAttr(ln=”border”, dt=”string”, keyable=1, w=1) cmds.setAttr(nloc + “.border”, ‘True’, type=”string”) # Transform selection in edges borderedg = cmds.polyListComponentConversion(bordervtx, fv=1, te=1, internal=True) # ... And delete the non-cuts edges! cmds.select(cl=True) for i in (edgestodelete): cmds.select(i, add=True) cmds.select(borderedg, d=True) cmds.delete() # feedback print len(PrimPoints),”Primary Points and”, len(SecondPoints), “Secondary Points Succefully created” # Define a function to calculate the distance between two points, # return the point position and the distance def distance(pt1,pt2): pt1 = cmds.pointPosition(pt1) pt2 = cmds.pointPosition(pt2) dx = pt1[0]-pt2[0] dy = pt1[1]-pt2[1] dz = pt1[2]-pt2[2]

distance = [] distance.append(dx) distance.append(dy) distance.append(dz) # Get the “3D” distance dxy = (dx**2+dy**2)**(.5) ad = (dxy**2+dz**2)**(.5) distance.append(ad) return distance ## Calculate the distances between each control points, and all the others points! def controlepoints(*arg): # Get the names of the selected points and store them in the surface attr. points = cmds.ls(sl=True, fl=1) cmds.select(‘surface’) cmds.addAttr(ln=”nbpoints”, dt=”string”, keyable=1, w=1) cmds.setAttr(“surface.nbpoints”, len(points), type=”string”) for i in range(0, len(points),1): cmds.select(‘surface’) cmds.addAttr(ln=”pointtooffset%s” %i, dt=”string”, keyable=1, w=1) cmds.setAttr(“surface.pointtooffset%s” %i, points[i], type=”string”) cmds.showHidden(‘surface’) # Define the controle points nbpoints = cmds.getAttr(‘surface.nbpoints’) Pointtooffset = [] for i in range (0, int(nbpoints),1): point = cmds.getAttr(‘surface.pointtooffset%s’ %i) Pointtooffset.append(point) # For each control point for n in (Pointtooffset): alreadycontroled = [] pointstoselect = [] # Number of vertices in total nbvertex = cmds.polyEvaluate(“surface”, v=True ) vertex = cmds.getAttr(n + “.vertex”) verticestoselect = cmds.select(‘surface.vtx[:]’)

CAD LOGIC SS 08/09 Slitting / documentation

AA’

verticestoselect = cmds.select(vertex, d=True) verticestoselect = cmds.ls(sl=True, fl=True) nbPrim = cmds.getAttr(“surface.nbPrim”) nbSecond = cmds.getAttr(“surface.nbSecond”) # Select the locator except the control point! cmds.select(cl=True) for i in range(int(nbPrim)): cmds.select(“PrimPoint_%s”%i, add=True) for i in range(int(nbSecond)): cmds.select(“SecondPoint_%s”%i, add=True) cmds.select(n, d=True) loc = cmds.ls(sl=True, fl=True) # Get the locators and its corresponding vertex. Locators = [] Vertices = [] for i in (loc): #index = Vertices.index(i) #loc = Locators[index] vertex = cmds.getAttr(i + “.vertex”) Locators.append(i) Vertices.append(vertex) # For each vertex, get the distance from the control point for v in (verticestoselect): d = distance(n,v) index = Vertices.index(v) loc = Locators[index] # And store the result in the locator attributes. cmds.select(loc) cmds.addAttr(ln=”distanceto%s”%n, dt=”string”, keyable=1, w=1) cmds.setAttr(loc + “.distanceto%s”%n, d[3], type=”string”) # Feedback print nbvertex, “distances from”,nbpoints,”points succesfully calculated “ # Define the main function ::: Move the points according to the new positions of # the control points! with a constant distance between them def Quinconce(*arg):

nbpoints = cmds.getAttr(‘surface.nbpoints’) Pointtooffset = [] # Get the control points for i in range (0, int(nbpoints),1): point = cmds.getAttr(‘surface.pointtooffset%s’ %i) Pointtooffset.append(point) # For each control point c for c in (Pointtooffset): # get its vertex name and move them to the new position xoffset = cmds.getAttr(c+”.translateX”) yoffset = cmds.getAttr(c+”.translateY”) zoffset = cmds.getAttr(c+”.translateZ”) controlvertex = cmds.getAttr(c+”.vertex”) cmds.move(xoffset,yoffset,zoffset, controlvertex, r=True) #cmds.move(xoffset,yoffset,zoffset, c, r=True) # polyevaluate the number of vertices and faces nbvertex = cmds.polyEvaluate(“surface”, v=True ) nbfaces = cmds.polyEvaluate(“surface”, f=True ) # Get the number of Primary & Secondary points nbPrim = cmds.getAttr(“surface.nbPrim”) nbSecond = cmds.getAttr(“surface.nbSecond”) # Store the name of these points with their corresponding vertices Locators = [] Vertices = [] for i in range(int(nbPrim)): nloc = “PrimPoint_%s” %i vertex = cmds.getAttr(nloc+”.vertex”) Locators.append(nloc) Vertices.append(vertex) for i in range(int(nbSecond)): nloc = “SecondPoint_%s” %i vertex = cmds.getAttr(nloc+”.vertex”) Locators.append(nloc) Vertices.append(vertex) # Get the points to move == all points except the point to offset # and eventually the borders points cmds.select(“surface.vtx[:]”) cmds.select(controlvertex, d=True) cmds.select(c, d=True) pointstomove = cmds.ls(sl=True, fl=1)

CAD LOGIC SS 08/09 Slitting / documentation

AA’

# For each pointomove for p in (pointstomove): # Get its corresponding locator index = Vertices.index(p) nloc = Locators[index] index = Pointtooffset.index(c) d1 = cmds.getAttr(nloc+”.distanceto%s” %c) # Get the new distance after offset d2 = distance(controlvertex, p) # Get the position of the moved main point & the initial point position pos1 = cmds.pointPosition(controlvertex) pos2 = cmds.pointPosition(p) # Draw a curve between these points! and get the new position of # the point on this curve curve = cmds.curve(p= [pos1, pos2], d=1) if float(d1) >= d2[3]: d = d2[3]/float(d1) else: d = float(d1)/d2[3] # Move the point to this new position cmds.select(curve) newpos = cmds.pointOnCurve( curve, pr=d , top=1, p=1) cmds.move(newpos[0], newpos[1], newpos[2], p, a=True) cmds.move(newpos[0], newpos[1], newpos[2], nloc, a=True) cmds.delete(curve) # Feedback print “Points succesfully moved” ########################## ### EXECUTE THE SCRIPT ### ########################## ########################## initparameters() ##########################

CAD LOGIC SS 08/09 Slitting / documentation

AA’

Read more

Similar to

Popular now

Just for you