Transform by vectors and Hash.
-
Very interesting Driven.
I have missed that topic completely during my searchs.
It's bedtime early today, so I have a closer peak tomorrow.
Thanks for the link. -
Had a peek inside that topic and while it's very interesting reading I'm uncertain it will help me in this case?
Refering to group make uniq! VS group name. It seems Group.name is a tad quicker.(horray!)
BUT, creating many new groups is very costly. In fact it's nearly half of the calculationtime for my script at the moment. Adding entities are of course expensive, but the difference between using instances and new groups is enourmous.(A longshot: There is no way to do Matrice calculations that affect tapering in Sketchup ?
I've gotten some shearing results when playing with the Matrix, but that's about it..)Biggest lag comes from transformation of vertices. Trying to bundle them do speed up things, but still far from satisfactory, and I doubt I'll ever get near any sufficient workable results..
So problem A is since making groups uniq and transforming by vectors are all SU API methods I can not get any benefit from a C-extension I persume? (If I ever go that route..)
Anyway I think I've made a big rookie misstake when preparing and gathering information for doing all in a big loop. But then again I don't if know slicing the code up will prevent from problem A? Confused right now
See if I can split up the code a little. Any suggestions would be appreciated.
-
You can only transform in one Entities object at a time - you cannot combine transformations in multiple Entities objects.
-
Ah ok, you are refering to tapering, right ?
I sent you PM.
-
@jolran said:
There is no way to do Matrice calculations that affect tapering in Sketchup ?
I don't know the API so well, but mathematically, the matrices would only be able to do what are known as "affine transformations", which have the property that lines which start out parallel with each other always remain parallel - so tapering would not be possible.
-
@unknownuser said:
mathematically, the matrices would only be able to do what are known as "affine transformations"
That IS what I wondered. Bummer
Whats the term for tapering? I've seen it being called "projective scaling". That is what I wanted to do to component instances anyway. Scaling one instance doesent affect the other and so on...
-
@jolran said:
Whats the term for tapering? I've seen it being called "projective scaling". That is what I wanted to do to component instances anyway. Scaling one instance doesent affect the other and so on...
You CAN do this.. BUT each instance must be unique.
Imagine a "Box" component.
Insert two instances a few feet from one another.
If you edit one instance, you will affect the other because they both share the same definition, that "owns" the entities collection.
But select one of them, right-click and choose "Make unique" and it has it's own definition.
Now.. double-click it to enter it's edit-mode. Select the top face, and then choose the ScaleTool.
Hold down the CTRL key and click-drag one of the corner handles to taper the top face (about the center.) -
Yeah Dan thanks, sort of doing that in my code already..
But what i wished for was tapering one instance and it doesent affect the other and so on.
Now that apparently can't be done with current API, otherwise Fredoscale taper-mode probably wouldent exist.
Don't know if that sort of thing could be added to the API anyway since Sketchup is a surface modeler. Maybe need nurbs for this kind of behaviour ?
Anyway getting OT on my own topic..
-
@jolran said:
Don't know if that sort of thing could be added to the API anyway since Sketchup is a surface modeler. Maybe need nurbs for this kind of behaviour ?
NO not now, because the vertice positions are part of the definition, and not part of the individual instance(s).
An interesting idea.
-
@unknownuser said:
NO not now, because the vertice positions are part of the definition, and not part of the individual instance(s).
Thanks for answering Dan.
It could be an useful addition to the API, IMO.What confuses me is that we are moving the vertices when scaling the instance(s) using Sketchup normal scaling behavior. So why would it be different if doing a tapering ?
I know the calculations for tapering is much more complex, but...
Maybe there is need for some symmetry calculation I havent thought about.
Advertisement