chilipeppr / widget-3dviewer

The amazing 3D viewer that is the centerpiece of ChiliPeppr. It knows how to parse Gcode to show it as a 3D representation. Has a simulator built in for the tool path. Also has numerous pubsub signals defined to enable 3rd party tools to inject 3D objects into the viewer.
16 stars 41 forks source link

Development thread: S parameter as variable opacity #2

Open ghost opened 8 years ago

ghost commented 8 years ago

screenshot from 2016-02-13 13-56-48

Hi John

I hope you wouldn't mind me opening a thread, but just easier to keep it going here where I can easily reference code lines, upload etc than the G+ community

So, from our discussion yesterday (https://github.com/chilipeppr/widget-3dviewer/pull/1)

I went ahead and added the subscribe

https://github.com/openhardwarecoza/widget-3dviewer/blob/master/widget.js#L138 and https://github.com/openhardwarecoza/widget-3dviewer/blob/master/widget.js#L189

and hopefully data published should trigger the function https://github.com/openhardwarecoza/widget-3dviewer/blob/master/widget.js#L3014

However, I don't see the function fire off (i.e. not logging to console) when I connect and disconnect to the TinyG

(As you can tell I am totally noob with the subscribe/publish, so going by example code from other widgets here)

chilipeppr commented 8 years ago

Do you see the event fire off in the JavaScript console? On Feb 13, 2016 4:15 AM, "Peter van der Walt" notifications@github.com wrote:

[image: screenshot from 2016-02-13 13-56-48] https://cloud.githubusercontent.com/assets/7695323/13027541/b8cd5ad2-d25b-11e5-9e66-7f4445bafbe5.png

Hi John

I hope you wouldn't mind me opening a thread, but just easier to keep it going here where I can easily reference code lines, upload etc than the G+ community

So, from our discussion yesterday (#1 https://github.com/chilipeppr/widget-3dviewer/pull/1)

I went ahead and added the subscribe

https://github.com/openhardwarecoza/widget-3dviewer/blob/master/widget.js#L138 and

https://github.com/openhardwarecoza/widget-3dviewer/blob/master/widget.js#L189

and hopefully data published should trigger the function https://github.com/openhardwarecoza/widget-3dviewer/blob/master/widget.js#L3014

However, I don't see the function fire off (i.e. not logging to console) when I connect and disconnect to the TinyG

(As you can tell I am totally noob with the subscribe/publish, so going by example code from other widgets here)

— Reply to this email directly or view it on GitHub https://github.com/chilipeppr/widget-3dviewer/issues/2.

ghost commented 8 years ago

Negative, I don't.

Does my implementation look correct though?

It's live on chilipepper.com/plasma

In the current version I added an Alert too in case i miss the console event (though that doesnt fire either)

On Sat, Feb 13, 2016 at 5:46 PM, John Lauer notifications@github.com wrote:

Do you see the event fire off in the JavaScript console? On Feb 13, 2016 4:15 AM, "Peter van der Walt" notifications@github.com wrote:

[image: screenshot from 2016-02-13 13-56-48] < https://cloud.githubusercontent.com/assets/7695323/13027541/b8cd5ad2-d25b-11e5-9e66-7f4445bafbe5.png

Hi John

I hope you wouldn't mind me opening a thread, but just easier to keep it going here where I can easily reference code lines, upload etc than the G+ community

So, from our discussion yesterday (#1 https://github.com/chilipeppr/widget-3dviewer/pull/1)

I went ahead and added the subscribe

https://github.com/openhardwarecoza/widget-3dviewer/blob/master/widget.js#L138 and

https://github.com/openhardwarecoza/widget-3dviewer/blob/master/widget.js#L189

and hopefully data published should trigger the function

https://github.com/openhardwarecoza/widget-3dviewer/blob/master/widget.js#L3014

However, I don't see the function fire off (i.e. not logging to console) when I connect and disconnect to the TinyG

(As you can tell I am totally noob with the subscribe/publish, so going by example code from other widgets here)

— Reply to this email directly or view it on GitHub https://github.com/chilipeppr/widget-3dviewer/issues/2.

— Reply to this email directly or view it on GitHub https://github.com/chilipeppr/widget-3dviewer/issues/2#issuecomment-183689818 .

chilipeppr commented 8 years ago

I'm at Whistler right now just waking up, so it would be hard for me to test. The widget that fires off that pubsub is the TinyG widget. I wonder if it is in fact firing off that pubsub. It is possible I documented that event but never fully tested it. Obviously the TinyG widget gets the firmware and puts it in the header, but it is possible the event doesn't fire. If you just run the TinyG widget on its own in test mode perhaps you could see if it fires.

If the firing of firmware version doesn't work, I do think your toggling was kinda cool. I just wanted to lighten up that label and/or possibly just put it in a pulldown mneu to reduce screen real estate usage.

On Sat, Feb 13, 2016 at 7:54 AM, Peter van der Walt < notifications@github.com> wrote:

Negative, I don't.

Does my implementation look correct though?

It's live on chilipepper.com/plasma

In the current version I added an Alert too in case i miss the console event (though that doesnt fire either)

On Sat, Feb 13, 2016 at 5:46 PM, John Lauer notifications@github.com wrote:

Do you see the event fire off in the JavaScript console? On Feb 13, 2016 4:15 AM, "Peter van der Walt" notifications@github.com wrote:

[image: screenshot from 2016-02-13 13-56-48] <

https://cloud.githubusercontent.com/assets/7695323/13027541/b8cd5ad2-d25b-11e5-9e66-7f4445bafbe5.png

Hi John

I hope you wouldn't mind me opening a thread, but just easier to keep it going here where I can easily reference code lines, upload etc than the G+ community

So, from our discussion yesterday (#1 https://github.com/chilipeppr/widget-3dviewer/pull/1)

I went ahead and added the subscribe

https://github.com/openhardwarecoza/widget-3dviewer/blob/master/widget.js#L138

and

https://github.com/openhardwarecoza/widget-3dviewer/blob/master/widget.js#L189

and hopefully data published should trigger the function

https://github.com/openhardwarecoza/widget-3dviewer/blob/master/widget.js#L3014

However, I don't see the function fire off (i.e. not logging to console) when I connect and disconnect to the TinyG

(As you can tell I am totally noob with the subscribe/publish, so going by example code from other widgets here)

— Reply to this email directly or view it on GitHub https://github.com/chilipeppr/widget-3dviewer/issues/2.

— Reply to this email directly or view it on GitHub < https://github.com/chilipeppr/widget-3dviewer/issues/2#issuecomment-183689818

.

— Reply to this email directly or view it on GitHub https://github.com/chilipeppr/widget-3dviewer/issues/2#issuecomment-183693867 .

ghost commented 8 years ago

(: No problem

Ray and I are going to start on the DXF in an hour or so... Should keep me busy for the rest of the night.

I'll come back to the Viewer work tomorrow or so - so no rush

I would need to get this working longer term though, there are other things I am working on where automatically detecting and adapting to the firmware would be cool.

Stealing my own thread, but I love how you only load the Eagle widgets once a Brd is dropped. I am wondering though, does that also mean we can have one workspace and pull in tinyg/grbl/etc widgets (instead of seperate workspaces) - using jquery we can show/hide buttons and features based on their availability?

Will test the widget on its own too. Didnt dig too deep, first time using pubsub here so more likely in between keyboard and chair (;

chilipeppr commented 8 years ago

Yeah, it would be possible to have one workspace. I think CP allowing anyone to create a workspace is a fundamental for enabling anyone to do anything they want to take CP in any direction, but if that eventually then turns into a unified workspace then that's a great progression. The /grbl workspace enabled an independent dev like Jarret Luft to do what he needed to make it work in a beautiful way. Most widgets he borrowed from TinyG, others he had to tweak heavily.

On Sat, Feb 13, 2016 at 8:02 AM, Peter van der Walt < notifications@github.com> wrote:

(: No problem

Me and Ray is going to start on the DXF in an hour or so... Should keep me busy for the rest of the night.

I'll come back to the Viewer work tomorrow or so - so no rush

I would need to get this working longer term though, there are other things I am working on where automatically adapting to the firmware would be cool.

Stealing my own thread, but I love how you only load the Eagle widgets once a Brd is dropped. I am wondering though, does that also mean we can have on workspace and pull in tinyg/grbl/etc widgets (instead of seperate workspaces) - using jquery we can show/hide buttons and features based on their availability?

Will test the widget on its own too. Didnt dig too deep, first time using pubsub here so more likely in between keyboard and chair (;

— Reply to this email directly or view it on GitHub https://github.com/chilipeppr/widget-3dviewer/issues/2#issuecomment-183694350 .

ghost commented 8 years ago

Understood and totally should stay that way. But there are definately use cases for a migration path of mature and approved widget into certain main workspace (like a "CNC" workspace) yet keeping the amazing abilities to be a not-a-cnc-interface too (beerbot for the win! and the Lua workspace was a awesome surprise too)

ghost commented 8 years ago

Fixed the issue with pubsub, i am now getting the publish can continue tomorrow