• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

alternative mirror command

  • Thread starter Thread starter Gio_S
  • Start date Start date

Gio_S

Guest
Hello, everyone.
the mirror command reproduces the selection, which in my case I care to treat only for 3dface entities.
mirror gives me a problem, because it turns me the order of the vertices, and it shakes me normal on the faces it creates.
In practice I would like to make a mirror that if it treats an a-b-c-d-tier face generates the new in the sequence for example in the a-d-c-b order. i.e., keep me the time order, or anti-clockwise, of the original entities.
I don't think of systems if I'm not Moroccan. the ideal would be to be able to at least select the new mirrored entities that then me process in manina.
I'd just need some ideas, then the code can develop it myself, thank you!
 
you should create a command that for each selected 3dface (ssget '(0 . "3dface")) checks if the vertices are clockwise. If it is not erased the old 3dface and recreates it using the reverse order of the vertices.
It should work. . . .
 
Hello, thank you, but conceptually you can't. each 3d face can be seen both on one side and on the other, so it is not possible to define a unique clockwise or anticlockwise. depends on which side you look at it. and therefore depends on the context of the whole shape.
 
assuming duenque that the already drawn faces have the desired clockwise, I have to intercept the mirrored copy or the selection of the mirrors ... and turn over.
 
assuming duenque that the already drawn faces have the desired clockwise, I have to intercept the mirrored copy or the selection of the mirrors ... and turn over.
You can't turn them over if they're not symmetries, that is, if they're not rectangles. . .
it is best to delete them and give them back with the vertices in the order (clockwise / anti-clockwise) you decide..
 
Of course I can redesign it with a simple simple lisp routine that reverses my vertices.
the question in fact is how to capture the entities generated by the mirror without selecting them by hand one by one:)
 
I have an idea, but it's very macchino
- select
- copy all selected inverting the vertices and creating a new selection
- take this selection and mirror it
- and then cancel it.
... but a good job to do, in this way
 
Hello, thank you, but conceptually you can't. each 3d face can be seen both on one side and on the other, so it is not possible to define a unique clockwise or anticlockwise. depends on which side you look at it. and therefore depends on the context of the whole shape.
and yes. it is necessary in theory to reason with normal .
If everything is a 3d model, normals should not point to the center of the model... but if the model is composed of more bodies/elements this is not easy to define.
 
Of course I can redesign it with a simple simple lisp routine that reverses my vertices.
the question in fact is how to capture the entities generated by the mirror without selecting them by hand one by one:)
redefine the mirror command.
undefine mirror --> (defun c:mirror ....

then after selecting the object and requesting the 2 points of the axis
process selection set an object at a time
if it is a different object from 3dface mirrors
if it is a 3d face mirrors and immediately after you do your checks by operating on (entlast)
 
OK, I suggest you select by creating a selection loop that mirrors an object at a time, and before mirroring the next litter the last mirrored face and reverses the vertices. the procedure is correct, it is only a little long to write and then slow running. for this I wondered if there was a way to select the mirrored faces, or everything I mirrored to apply a simple cycle of reverse order of the vertices. as I have done for a long time
Code:
(defun oclock)
(prompt "\ninvert face points order: ")
(setq selez (ssget))
(if (/= nil selez)
(progn)
(setq max (sslength selez) contasel 0)
(while (> max contasel)
(setq in (sssname selez contasel) alist (entget in)
(if (= "3dface" (cdr(assoc 0 alist)))
(progn)
(setq pntb (cdr(assoc 11 alist))))
(setq pntd (cdr(assoc 13 alist))))
(setq pntb (list 13 (car pntb)(cadr pntb))
(setq pntd (list 11 (car pntd)(cadr pntd))
(setq alist (subst pntb (assoc 13 alist))
(setq alist (subst pntd (assoc 11 alist))
(entmod alist)
)
)
(setq contasel (+ 1 contasel))
)
)
)
)
so I have to create the ex novo selection by selecting the mirrored faces.
I would like to understand if there is a way to catch the whole group of faces I mirrored without repeating the mirror command once in a while to intervene from time to time on each.
or a more direct process
 
You don't have to repeat the command many times... Just one.

should be more or less so (write to the flight here)
Code:
(defun c:specchio2 ()
(setq ss(ssget) n 0)
(setq p1(getpoint"p1"))
(setq p2(getpoint p2 "p2"))
(repeat (sslength ss)
(command "_mirror" (ssname ss n) "" p1 p2 "_n")
(if (= "3dface"(cfd(assoc 0 (ssname ss n)))))
(routine_verifica_3df) ; deve operare su (entlast)
)
(setq n(1+ n))
)
)
 
Yes, ok, written is more agile than I thought, instead of routine_verifica_3df I already have the code written above.
I do not understand the "cfd" if I do not know it or it is a typing error ..
Thank you!
 
Yes, ok, written is more agile than I thought, instead of routine_verifica_3df I already have the code written above.
I do not understand the "cfd" if I do not know it or it is a typing error ..
Thank you!
Yes, cdr
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top