Posts made by chrisglasier
-
RE: [Talk] Plugins Quarantine
@dan rathbun said:
Chris, I am sorry. None of your ideas are feasible.
Sorry...
No sorry as my Chinese friends say.
I do not have anything like the needed depth of knowledge of Ruby to react further but maybe an ignoramus's proposal may excite more people to question and explore new approaches.
Really my primary interest is exploring reloading imported files to accommodate duplication of names in environments other than html/javascript.
On your last post: As an American you probably understand Prohibition better than me!
-
RE: [Talk] Plugins Quarantine
@chrisglasier said:
... one more on this point
@tig said:
So if some code contains the phrase Sketchup::Group you'd ban it - NO, because that occurs is many ...is_a?(...) test !
Thinks - if all were rejected it would force developers to use Modules. Module names can be duplicated if accommodated on the lines noted in the last post.
Or on second thoughts just check all is in Module; if not wrap it in one with plug-in name. Can it be that simple?
-
RE: [Talk] Plugins Quarantine
... one more on this point
@tig said:
So if some code contains the phrase Sketchup::Group you'd ban it - NO, because that occurs is many ...is_a?(...) test !
Thinks - if all were rejected it would force developers to use Modules. Module names can be duplicated if accommodated on the lines noted in the last post.
-
RE: [Talk] Plugins Quarantine
@tig said:
Your idea only works in plain coded .rb file, because compiled .rbs scripts are inaccessible...
Doesn't checking get done on selection so the source is irrelevant. In JS the only checking of file content is done if you request validation.
@tig said:
So if some code contains the phrase
Sketchup::Group
you'd ban it - NO, because that occurs is many...is_a?(...)
test !
Yes... theclass Sketchup::Group
would be trappable, but what if it made a very unique new addition to the class's method, rather than rewrote an existing one [which should be stopped BUT who compiles the lists etc ?]I was just thinking of an uncomplicated search of the API for matching words - Alex's cheat sheets come to mind which Jim and I used to make an API machine.
@tig said:
or then... worse because it now clashed with a matching-named custom method made by another's script [which one gets precedence] ??
Well that's the second part of the request -
@unknownuser said:
... and accommodates any possible duplication of names between all plug-ins **.
...
**For example, one suggestion is to reload the .rb file of the selected plug-in so that it overwrites any duplicates.
@tig said:
I can't see how this wold be manageable by 'us'.
It should not be. In developing my own applications I accept that I need to be responsible for ensuring imported devices cannot clash.
@tig said:
Perhaps an 'obersturmführer' Sketchup-System tool could oversee it, but then I fear a 'terminator' rather that the marginally more preferable 'judge-dread' app...
Lost in the imagery!
-
RE: [Talk] Plugins Quarantine
@thomthom said:
That's not what I mean - asking the SketchUp developers to change the core of Ruby. Even if that would happen - it wouldn't happen for a very long time.
I mean what can we actually do?
Assuming we can work out and agree a coherent request it may take sometime. But if we could market it on the grounds, say, that existing Trimble users will need new plug-ins for their specialist work; if it could be heavily promoted at the imminent base camp; it may have a chance to be treated as a separate enhancement of the core soon.
Just doing nothing just guarantees it will never happen.
Helping with this in the way I have proposed is really all I am capable of. Sorry.
-
RE: [Talk] Plugins Quarantine
@thomthom said:
Yes, but again - what can we do?
Give http://forums.sketchucation.com/viewtopic.php?f=323&t=47388 a chance?
-
RE: [Talk] Plugins Quarantine
@tig said:
How exactly would you do this ?
Well of course I am no expert but it seems to me that if any of the words used for classes, methods or whatever in the API appear in a plugin then that plugin should simply not work, unless of course the words were used inside a Module. This seems to follow what I see with JavaScript reserved words and duplicated words protected within different directories. If something like this were possible hopefully Sketchup would issue a free patch for their application.
Worth discussing don't you think?
-
RE: [Talk] Plugins Quarantine
@tig said:
I agree that Matchbox and SunPosition [?] should "disappear" - they have no merit that counteracts their problems.
SketchyPhysics has it's fan-base, but is a problem with base-class fiddling... so "warn!" and no 'support' to anyone who uses it.
DrivingDimensions is similar... BUT its author is arrogant and does nothing to fix the mess his tool makes, despite advisements... I say "strong warning!" and no 'support' [ever] to anyone who uses it.Simply if the problem is base-class fiddling then the base-classes should be protected by design not dictum. Technical prowess not personal intervention.
-
Plug in Controller
Arising from talk in Jim's Plugin Quarantine Topic, I offer this draft of a Sketchup Feature Request for review, comment revision and hopefully endorsement:
%(#0040BF)[To provide a fertile environment for plugin development we request Sketchup provide a built-in plugin loader that rejects any plugins that modify any base classes and accommodates any possible duplication of names between all plug-ins **.
Endorsed by:
**For example, one suggestion is to reload the .rb file of the selected plug-in so that it overwrites any duplicates.]
-
RE: [Talk] Plugins Quarantine
@thomthom said:
@chrisglasier said:
Any devices with any function prefixed core will not work. Couldn't this be applied to core Sketchup as part of Trimble's application?
That would be something the SketchUp devs would have to do. We cannot modify the SketchUp core. A more robust plugin environment, even a sandbox feature authors can opt in for would be nice. But it's a SketchUp feature request, which is another topic all together. What can we do right now, as is? Today, or this week?
Well I could draft the request if you and the others agree to check it and endorse it ... in a new topic of course.
-
RE: [Talk] Plugins Quarantine
As usual I failed to expose essential details behind my proposal. Simply though the applications I have made using JavaScript have a core section which provides the basic mechanism to manipulate raw data and individual devices which make different types of multimedia displays from it. The devices could be loaded all at once to create a situation similar to an environment of Sketchup plugins.
Many of my devices have a start() function so the last one loaded is always current. To ensure the right start function matches the selected device I have its file reloaded after the device has been selected. I don't know if that can be done in Ruby. If so I think the comparison is valid.
Any devices with any function prefixed core will not work. Couldn't this be applied to core Sketchup as part of Trimble's application?
Just ideas ...
-
RE: [Talk] Plugins Quarantine
@thomthom said:
... we need to deal with it as is and not in some utopic theoretic manner.
I thought this kind of Luddite attitude had faded ever since we learned Englebart, Gates, Berners-Lee had faced the same charge.
@thomthom said:
That sounds complicated and open to any kind of bugs and unforeseen issues.
SketchUp has a shared environment where all plugins reside in.Well it isn't at least in JavaScript. After all I am only suggesting rearranging the same environment on selection of a plugin.
@unknownuser said:
Because of that it is each developer's responsibility to ensure they encapsulate everything to avoid clashes.
Now that does not work because you are involving human policing. Anyone can create a website. If they don't follow the language rules it won't work. It will never compromise any other website as far as I know. The existing Sketchup plugin system should be modified for the same ends.
@unknownuser said:
If you got alternative ideas, then by all means, do share it. But please let it be practical and pragmatic dealing with the reality of the current situation.
Be careful with remarks like that!
(Toffler:"Idea-assassins rush forward to kill any new suggestion on the grounds of its impracticality, while defending whatever now exists as practical, no matter how absurd.") -
RE: Apartment kitchen
The depth of wall hung cabinets appear to be too deep to be usable.
-
RE: [Talk] Plugins Quarantine
@jim said:
For disussions related to the Plugins Quarantine area.
Questions, comments, suggestions, and insults accepted.
You have helped me a great deal in the past not only to appreciate a rational approach to software but also to speak out if something seems wrong. I am grateful for that. This quarantine idea is terrible.
You really want to introduce a new human system with lists and banning when surely the goal is self-organising non-human systems that neither censure nor inhibit human endeavour (here, in developing plugins) rather support it. Like WWW.
If there is a conflict of names the last to be loaded will prevail. So isn't the trick to load the code every time a plug in is selected. This would be the job of the system loader. It is for the developer to ensure there is no conflict within his own coding and its included files; in this respect the multi-level namespaces/modules are most useful. (But these can never be the ultimate global defense because they rely on human choice.)
I just saw TT's note about altering base classes. That is a problem when these have not been uniquely pre-fixed/identified and reserved. I don't have a solution ... perhaps some kind of filtering/renaming in the loader ... but I know banning is not a workable/acceptable solution for this era.
-
RE: Interior design
@unknownuser said:
....
Please if you have any suggestions about the design or questions let me know.I think if the ceiling panels were simply raised and fielded rather than bad fung shui pyramidal and the wood was bleached oak or something like that, it would be very sexy. Reminds of ceilings I have seen in Florence.
You asked ...
-
RE: [Logic emerged] Articulation in animation
It seems a certain amount of time has to pass before some kind of logic emerges.
In this case it was that each loco/wagon needed its own fully incremented path for the starts and optionally finishes to be staggered. Here is a screenshot of the train in motion with the "normal" scale view inset. Room for improvement of course especially with curve coordinates.
For the animation click New machines and follow the train link.
Thanks Dan for the background inspiration.
-
RE: [Logic emerged] Articulation in animation
Another version, which better fits with what you say Dan (maybe), is to interpolate the real starts and finishes of path sections so that the path provides coordinates at fixed increments. The getX() of each car finds the nearest x increment and reads off its Y value.
The 14 deg (0.1 radian) arcs (curves) use 51 frames at the current settings. I cannot change the milliseconds, only the increments. Here is a nameset record showing typical data.
"10";{ "Entry";"10", "Label";"T10", "Class";"Track", "Category";"Curve", "Backlink";["Tracks"], "Keyset";"KS01", "X";72855, "Y";159891, "Radius";60000, "Rotation";-20, "Direction";"Leftdown", "Arc";0.1, "Length";18818, "OffsetY";3027 },
I am not sure and hungry!
-
RE: [Logic emerged] Articulation in animation
As we seem to be thinking in parallel let me set out what I am doing right now to help define options.
All the x values of both straights and curves are accumulated as the path array is assembled. When the type is a curve it stores [start,finish,max Y offset] in a curve array. Later the rotIncr (horizontal rotation) will be added.
function createPath(){ var cp,t,radian,distX,distY; cp = config.pass; path = []; accX = cp.locoXYR[0]; cp.carray = [] for(a=0; a<cp.tracks.length; a+=1){ rotIncr = null; t = nset[cp.tracks[a]]; radian = t.Rotation * Math.PI / 180; distX = Math.cos(radian) * t.Length; lastAccX = accX; accX += distX; distY = 0; //curves if(t.Category === "Curve"){ switch(t.Direction){ case "Rightup"; x = -1; break; case "Leftdown"; x = -1; break; case "Rightdown"; x = 1; break; case "Leftup"; x = 1; break; } distY += t.OffsetY * x; rotIncr = t.Arc / t.Length * x; //rotIncr = incr * t.OffsetY / t.Length; cp.carray.push([Math.round(lastAccX),Math.round(accX),Math.round(distY)]); } distY += Math.sin(radian) * t.Length; distX = Math.abs(Math.round(distX)); distY = Math.abs(Math.round(distY)); path.push([t.Entry,t.Category,distX,distY,rotIncr]); } lert(cp.carray.join("<br>")); return path; }
Now doing ...
In the animator ...
Each loco/wagon's getX() is compared to the carray. If within any of the array elements start/finish, the Y incr is interpolated, the running Y value updated and the rotIncr applied.
Here is the code before doing this:
function animate(nr){ var cp,steps,offsetX,offsetY,count,a; cp = config.pass; steps = Math.round(cp.path[nr][2] / cp.incr); offsetX = cp.path[nr][2]/steps; offsetY = cp.path[nr][3]/steps; count = 0; stage = coreKJSStage(); stage.onFrame(function(frame){ if(count < steps){ for(a=0; a<cp.train.length; a+=1){ car = coreKJSShape(cp.train[a]); incrX = car.getX() + offsetX * -cp.dir[0]; incrY = car.getY() - offsetY * -cp.dir[1]; car.setX(incrX); car.setY(incrY); } KJSLayer("Trains"); count += 1; } else{ stage.stop(); nr += 1; if(cp.path[nr]){ animate(nr); } } }); stage.start(); }
I understand what you are saying about rotation, speed (increments), zooming and so on, but I just wanted to see first how to offset the cars individually.
Interested to hear what you think.
Back to the animater!
Edit GMT 10.30 + 8: doesn't work! Trying another tack on same basic idea