Skip to content

Instantly share code, notes, and snippets.

View leefsmp's full-sized avatar

Philippe Leefsma leefsmp

  • Switzerland
  • 04:52 (UTC +02:00)
View GitHub Profile
@leefsmp
leefsmp / Autodesk.ADN.Viewing.Extension.ModelStructure.js
Created March 24, 2016 15:19
View & Data Model Structure extension
///////////////////////////////////////////////////////////////////////////////
// ModelStructure viewer extension
// by Philippe Leefsma, March 2016
//
///////////////////////////////////////////////////////////////////////////////
AutodeskNamespace("Autodesk.ADN.Viewing.Extension");
Autodesk.ADN.Viewing.Extension.ModelStructure = function (viewer, options) {
Autodesk.Viewing.Extension.call(this, viewer, options);
@leefsmp
leefsmp / Viewing.Extension.Markup3D.js
Created April 22, 2016 09:37
Markup3D Viewer Extension for View & Data API (partial sample)
/////////////////////////////////////////////////////////////////////
// Viewing.Extension.Markup3D
// by Philippe Leefsma, April 2016
//
/////////////////////////////////////////////////////////////////////
import Snap from 'imports-loader?this=>window,fix=>module.exports=0!snapsvg/dist/snap.svg.js';
import Markup3DTool from './Viewing.Extension.Markup3D.Tool'
import ExtensionBase from 'ExtensionBase'
class Markup3DExtension extends ExtensionBase {
@leefsmp
leefsmp / viewer-and-data-npm-2.0.0-test.js
Last active April 26, 2016 07:15
Test for View & Data NPM 2.0.0 Package
/////////////////////////////////////////////////////////////////////
// Copyright (c) Autodesk, Inc. All rights reserved
// Written by Philippe Leefsma 2015 - ADN/Developer Technical Services
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
@leefsmp
leefsmp / BarChart.js
Created May 3, 2016 06:03
Simple BarChart using d3 API
/////////////////////////////////////////////////////////////////////
// BarChart
// by Philippe Leefsma, April 2016
//
// Simple BarChart using d3 API
//
/////////////////////////////////////////////////////////////////////
import EventsEmitter from 'EventsEmitter'
import './BarChart.css'
import d3 from 'd3'
@leefsmp
leefsmp / PieChart.js
Created May 3, 2016 06:06
Simple PieChart using d3Pie API
/////////////////////////////////////////////////////////////////////
// PieChart
// by Philippe Leefsma, April 2016
//
// Simple PieChart using d3Pie API
//
/////////////////////////////////////////////////////////////////////
import EventsEmitter from 'EventsEmitter'
import d3pie from 'd3pie'
import d3 from 'd3'
@leefsmp
leefsmp / ForceGraph.js
Created May 3, 2016 06:07
Simple ForceGraph using d3 API
/////////////////////////////////////////////////////////////////////
// ForceGraph
// by Philippe Leefsma, April 2016
//
// Simple ForceGraph using d3 API
//
/////////////////////////////////////////////////////////////////////
import EventsEmitter from 'EventsEmitter'
import './ForceGraph.css'
import d3 from 'd3'
@leefsmp
leefsmp / Viewing.Tool.Rotate.js
Created July 4, 2016 14:10
Rotation Control for Autodesk Viewer
import EventsEmitter from 'EventsEmitter'
export default class RotateTool extends EventsEmitter {
/////////////////////////////////////////////////////////////////
// Class constructor
//
/////////////////////////////////////////////////////////////////
constructor (viewer) {
@leefsmp
leefsmp / ForgeSvc.js
Last active August 2, 2016 13:44
Forge server-side service for node
///////////////////////////////////////////////////////////////////////
// Copyright (c) Autodesk, Inc. All rights reserved
// Written by Philippe Leefsma 2016 - ADN/Developer Technical Services
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
@leefsmp
leefsmp / forge.js
Last active July 19, 2016 10:44
Forge endpoint oauth implementation for node
///////////////////////////////////////////////////////////////////////
// Copyright (c) Autodesk, Inc. All rights reserved
// Written by Philippe Leefsma 2016 - ADN/Developer Technical Services
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
@leefsmp
leefsmp / OssSvc.js
Created July 25, 2016 14:50
OSS API Node Service for the Forge Sample
import BaseSvc from './BaseSvc'
import jsonfile from 'jsonfile'
import request from 'request'
import util from 'util'
import fs from 'fs'
export default class OssSvc extends BaseSvc {
/////////////////////////////////////////////////////////////////