ref_poly: how to force to start with [0.000] [0.000] value?

Schlagworte:
  • 2014

Hi!

After several test, the new order ref_poly seems to start randomly the sequence of the variables. Always the sequence is ordered, but the origin value, [0.000] [0.000], never is in the same row position.

Is possible to force ref_poly to start the sequence of the variables with [0.000] [0.000] value?

The goal is, for example, control the heights of the jambs of the openings, to distribute correctly the hinges.

thanks a lot!
Xavi

Xavier Coll • Architect, Project Manager I+D, BIM Manager, BIM Auditor
EiPM • http://www.eipm.es/en/

Anhänge (1)

Typ: image/jpeg
541-mal heruntergeladen
Größe: 208,23 KiB

Hi Xavi,

there is no possibility to enforce that Array starts with [0.00,0.00].
But it doesn't matter, because this assertion would you not help really !
If you want to have this, then you can "rotate" the array in the script
until 0.00,0.00 is at position[1][1].

However, the width and height of the polygon you can find in ref_x and ref_z.
(max. dimensions = bounding box)

A good solution for "cutting" the jambs is:
-create a prism with ref_poly-points (maybe with offset for frame)
-make boolean intersection (GROUP_ISECT) of jambs with this prism

For working with arbitrary polygons there are some new functions available in PolyOperationsAddon. You have access to this with commands:

INITADDONSCOPE
PREPAREFUNCTION
CALLFUNCTION

and have functionality for boolean operations and offsetting a polygon.

For further documentation read here:

Link

In addition to this we have added 3 functions:

PREPAREFUNCTION ch, "MoveBack", ...
PREPAREFUNCTION ch, "PolyOffsetParams", ...
CALLFUNCTION (ch, "PolyOffsetEdges", ...)

Furthermore we have new commands for creating a frame (similar to PRISM)

FRAME
FRAME_D

Regards.

Jörg

Thank you very much for your quick response, Jörg, is very interesting :-D

We are testing the new command "ref_poly", along with commands prism and frame, doing Boolean operations with groups,and we has achieved very good results using those new commands. It's a good solution to create windows and doors adapted to inclined reference planes.

We will study the commands that you have suggested: INITADDONSCOPE, PREPAREFUNCTION,CALLFUNCTION, and I will try to use them. Any sample? ;-D

Jörg, in your post, you write: "If you want to have this, then you can "rotate" the array in the script until 0.00,0.00 is at position" I'm very surprising, how to do it?

Thanks a lot!
Xavi

Xavier Coll • Architect, Project Manager I+D, BIM Manager, BIM Auditor
EiPM • http://www.eipm.es/en/

Hi Xavi,

"rotate" the array:
--------------------------------------------------------
eps = 0.001
cnt = VARDIM1 ( REF_POLY )
x = 1
y = 2
!find 0
idx = 0
FOR i = 1 TO cnt
IF ABS ( REF_POLY [ i ][ x ]) < eps AND ABS ( REF_POLY [ i ][ y ]) < eps THEN
idx = i
BREAK
ENDIF
NEXT i
!rotate
IF idx > 0 THEN
IF idx = 1 THEN
!nothing to do
ELSE
DIM tmp [ cnt ][ y ]FOR i = 1 TO cnt - 1
!source index
src = idx + i - 1
IF src > cnt THEN
src = src - cnt
ENDIF
!copy values
tmp [ i ][ x ]= REF_POLY [ src ][ x ]tmp [ i ][ y ]= REF_POLY [ src ][ y ]NEXT i
!!add closing
tmp [ cnt ][ x ]= tmp [ 1 ][ x ]tmp [ cnt ][ y ]= tmp [ 1 ][ y ]!assing
REF_POLY = tmp
PARAMETERS REF_POLY = REF_POLY
ENDIF
ENDIF
-----------------------------------------------------------------------
Regards

Jörg

Wow! thanks Jörg! :-D

Mmmm... I'm trying the script, and I add it in "Parameters script", but something don't works well.

I post two screenshots: the first is before add the script "rotate array", and the second is after add the script.

Thanks!
Xavi

Xavier Coll • Architect, Project Manager I+D, BIM Manager, BIM Auditor
EiPM • http://www.eipm.es/en/

Anhänge (2)

Typ: image/jpeg
517-mal heruntergeladen
Größe: 116,04 KiB
Typ: image/jpeg
573-mal heruntergeladen
Größe: 117,32 KiB

Hi Xavi,

here the corrected script:

eps = 0.001
cnt = VARDIM1 ( REF_POLY )
x = 1
y = 2
!find 0
idx = 0
FOR i = 1 TO cnt
IF ABS ( REF_POLY [ i ][ x ]) < eps AND ABS ( REF_POLY [ i ][ y ]) < eps THEN
idx = i
BREAK
ENDIF
NEXT i
!rotate
IF idx > 0 THEN
IF idx = 1 THEN
!nothing to do
ELSE
DIM tmp [ cnt ][ y ]FOR i = 1 TO cnt - 1
!source index
src = idx + i - 1
IF src > cnt - 1 THEN
src = src - cnt + 1
ENDIF
!copy values
tmp [ i ][ x ]= REF_POLY [ src ][ x ]tmp [ i ][ y ]= REF_POLY [ src ][ y ]NEXT i
!!add closing
tmp [ cnt ][ x ]= tmp [ 1 ][ x ]tmp [ cnt ][ y ]= tmp [ 1 ][ y ]!assing
REF_POLY = tmp
PARAMETERS REF_POLY = REF_POLY
ENDIF
ENDIF

By the way, this would you not help really for arbitrary Polygons :-)

Regards.

Jörg

Fantastic Jörg, it's working perfectly! :-D

This script will be very useful for our smartpart :-)

Thanks a lot, Jörg!
Regards,
Xavi

Xavier Coll • Architect, Project Manager I+D, BIM Manager, BIM Auditor
EiPM • http://www.eipm.es/en/