This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def normalizeAngle(angle,amin=-180,amax=180): | |
"normalizes the given angle" | |
if angle > amax: | |
return normalizeAngle(angle-amax) | |
elif angle < amin: | |
return normalizeAngle(angle+amin) | |
else: | |
return angle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cutycapt --url=file:///home/yorik/Site/index.html --out=/tmp/tmpthumb.jpg && convert /tmp/tmpthumb.jpg -thumbnail 150x180^ -gravity NorthWest -extent 150x180 thumb.jpg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#*************************************************************************** | |
#* * | |
#* Copyright (c) 2013 * | |
#* Yorik van Havre <[email protected]> * | |
#* * | |
#* This program is free software; you can redistribute it and/or modify * | |
#* it under the terms of the GNU Lesser General Public License (LGPL) * | |
#* as published by the Free Software Foundation; either version 2 of * | |
#* the License, or (at your option) any later version. * | |
#* for detail see the LICENCE text file. * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Python 2.7.5+ (default, Jun 2 2013, 13:28:26) | |
[GCC 4.7.3] on linux2 | |
Type 'help', 'copyright', 'credits' or 'license' for more information. | |
>>> App.setActiveDocument("Unnamed") | |
>>> App.ActiveDocument=App.getDocument("Unnamed") | |
>>> Gui.ActiveDocument=Gui.getDocument("Unnamed") | |
>>> import Draft | |
>>> pl = FreeCAD.Placement() | |
>>> pl.Rotation.Q = (0.0,-0.0,-0.0,1.0) | |
>>> pl.Base = FreeCAD.Vector(-1.33731794357,0.644989609718,0.0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# custom object definition | |
class MyCustomObject(): | |
def __init__(self,obj): | |
obj.addProperty("App::PropertyStringList","CustomProps","Base", "A placeholder for custom properties") | |
obj.Proxy = self | |
def execute(self,obj): | |
pass | |
# create one in the current doc | |
myobj = FreeCAD.ActiveDocument.addObject("App::FeaturePython","MyObject") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>ACE in Action</title> | |
<style type="text/css" media="screen"> | |
#b3 { | |
position: absolute; | |
top: 5%; | |
right: 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/3rdParty/Pivy-0.5/coin_wrap.cpp b/src/3rdParty/Pivy-0.5/coin_wrap.cpp | |
index ee304d6..fe1c8d7 100644 | |
--- a/src/3rdParty/Pivy-0.5/coin_wrap.cpp | |
+++ b/src/3rdParty/Pivy-0.5/coin_wrap.cpp | |
@@ -1,3 +1,4 @@ | |
+ | |
/* ---------------------------------------------------------------------------- | |
* This file was automatically generated by SWIG (http://www.swig.org). | |
* Version 1.3.36 | |
@@ -880,7 +881,11 @@ SWIG_Python_AddErrorMsg(const char* mesg) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pivy import coin | |
import SketcherGui | |
coin.SoType.fromName("SoDatumLabel") | |
l=coin.SoType.fromName("SoDatumLabel").createInstance() | |
l.Type | |
l.string.setValue("Yorik") | |
sg=Gui.ActiveDocument.ActiveView.getSceneGraph() | |
sg.addChild(l) | |
l.datumtype.getValue() | |
l.datumtype.setValue(2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# creates an empty file | |
f=IfcImport.open("") | |
# this writes the file to disc, in this case a minimal header | |
f.write("/home/yorik/test1.ifc") | |
# adding entities | |
pnt = IfcImport.Entity("ifccartesianpoint") | |
f.add(pnt) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/App/PropertyFile.cpp b/src/App/PropertyFile.cpp | |
index 13599c8..70b0f7e 100644 | |
--- a/src/App/PropertyFile.cpp | |
+++ b/src/App/PropertyFile.cpp | |
@@ -296,7 +296,7 @@ void PropertyFileIncluded::Restore(Base::XMLReader &reader) | |
void PropertyFileIncluded::SaveDocFile (Base::Writer &writer) const | |
{ | |
- Base::ifstream from(Base::FileInfo(_cValue.c_str())); | |
+ std::ifstream from(_cValue.c_str()); |