Creando una carretera ahora en plugins

Miguel-Arte-3D-1990 - 13/10/2013 23:25
Les dejo este código como ejemplo :
Plugin simpleObject Carretera.

Name:Carretera.

Classid:#(0x27f6fed4, 0x61c91d2).

Category:Crear una carretera.
(.

Parameters main ut:params.
(tLength type:#float default:32 ui:spn_length.
width type:#float default:100 ui:spn_width.

Thickness type:#float default:2 ui:spn_thickness t tlengthSegs type:#integer default:3 ui:spn_lengthSegs.
widthSegs type:#integer default:10 ui:spn_widthSegs.
).

Rollout params Parámetros Carretera.
(tgroup Dimensiones t(.

Spinner spn_Length Length range:[0,100000,0].

Spinner spn_width Width range:[0,100000,0].

Spinner spn_thickness Thickness range:[0.01,100000,1] t) tgroup Segmentos t(.

Spinner spn_lengthSegs Length Segs range:[1,10,1] type:#integer.

Spinner spn_widthSegs Width Segs range:[1,10,1] type:#integer .
).
).

On buildMesh do.
(.

BottomBox = createInstance box width:width length:Length height:thickness lengthSegs:lengthSegs widthSegs:widthSegs.

Mesh = bottomBox.mesh.
).

Tol create.
(.

On mousePoint click do.
(.

Case click of.
(.
1: nodeTM.translation = gridPoint.
2: #estop.
).
).

On mouseMove click do.
(.

Case click of.
(.
---2: (width = abs gridDist.x*2; Length = abs gridDist, y*2).
).
).
).
)--- end plugins.

Pero, trato de hacer ahora con un Shape.

Como el ejemplo que tengo en el tema: script Crear una Carretera y mi etiqueta es 3dsmx5 hasta 3dsmax12.

Y espero su ayuda Gracias. Un Saludo De Chapolín. ^.^d.
Miguel-Arte-3D-1990 - 15/10/2013 04:55
Bueno la idea es, como crear una Line LINEA en un plugin.

Les dejo este ejemplo.
1.- tengo que hacer una función para crear una línea.

En este código :
Fn LineaEntreDosPuntos pointA pointB =.
(.

Linea = SplineShape pos: pointA.

AddNewSpline línea.

Addknot línea 1 #corner #line pointA.

Addknot línea 1 #corner #line pointB.

UpDateShape línea.

Linea.
).

Linea = LineaEntreDosPuntos [0,0,0] [100,0,0].
2.- cambiar box por línea.

Seria a si.

On buildMesh do.
(.

Bottomlinea = createInstance línea ---- y quitar esto ---> width:width length:Length height:thickness lengthSegs:lengthSegs widthSegs:widthSegs.

Mesh = bottomlinea, mesh.
) --- o a si.

On buildMesh do.
(.

Bottomlinea = createInstance línea = LineaEntreDosPuntos [0,0,0] [100,0,0].

Mesh = bottomlinea, mesh.
) --- o a si.

On buildMesh do.
(.

Bottomlinea = createInstance SplineShape.

Mesh = bottomlinea, mesh.
) --- o a si.

Alguien me podría resolver la lógica.

En lugar de crear una caja, que me crea una línea.

Y espero su ayuda. Gracias. Un Saludo de Chapolín ^.d.
Miguel-Arte-3D-1990 - 16/10/2013 04:28
Hola les dejo otro ejemplo, sobre este Código.

No sé, si estoy resolviendo la función del shape.

No sé, si estoy bien o dónde está la clavé.

Para qué me de la función correcta.

Y espero que me ayuden gracias.

Código :
Plugin simpleObject Carretera.

Name:Carretera.

Classid:#(0x27f6fed4, 0x61c91d2).

Category:Crear una carretera.
(.

Parameters main ut:params.
(tLength type:#float default:32 ui:spn_length.
width type:#float default:100 ui:spn_width.

Thickness type:#float default:2 ui:spn_thickness t tlengthSegs type:#integer default:3 ui:spn_lengthSegs.
widthSegs type:#integer default:10 ui:spn_widthSegs.
).

Rollout params Parámetros Carretera.
(tgroup Dimensiones t(.

Spinner spn_Length Length range:[0,100000,0].

Spinner spn_width Width range:[0,100000,0].

Spinner spn_thickness Thickness range:[0.01,100000,1] t) tgroup Segmentos t(.

Spinner spn_lengthSegs Length Segs range:[1,10,1] type:#integer.

Spinner spn_widthSegs Width Segs range:[1,10,1] type:#integer .
).
).

On buildMesh do t(.
-- pb = point().
-- pb, cross = of.
-- pb, box = on.
-- pb, size = 10.
-- pb, name = b.
-- para = point().
-- pa, pues = [0,0,0].
-- pa, name = a.
-- .

Fn LineaEntreDosPuntos pointA pointB = t (t línea = createInstance splineshape pos:pointA t t línea, render_displayRenderMesh = on t línea, thickness = 32 t línea, sides = 8.
-- scale línea [1,1,0.01].
-- línea.wirecolor = color 166 166 166.
-- línea, render_displayRenderSettings = on.
-- línea, render_renderable = on.
-- línea, thickness = 32.
-- línea, sides = 4 t t ---addNewSpline línea.
-- addknot línea 1 #corner #line pointA.
-- addknot línea 1 #corner #line pointB.
-- upDateShape línea.
-- línea t ) t línea = LineaEntreDosPuntos [0,0,0] [100,0,0].
--- bottomBox = createInstance box ---idth:width length:Length height:thickness lengthSegs:lengthSegs widthSegs:widthSegs.
--- mesh = bottomBox.mesh.
).

Tol create.
(.

On mousePoint click do.
(.

Case click of.
(.
1: nodeTM.translation = gridPoint.
2: #estop.
).
).

On mouseMove click do.
(.

Case click of.
(.
---2: (width = abs gridDist.x*2; Length = abs gridDist, y*2).
).
).
).
)--- end plugins ---- Saludos de Chapolín ^^d.