<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Datei von XML zu STL mit C++]]></title><description><![CDATA[<p>Hallo Leute</p>
<p>Hab gerade in der Uni die Aufgabe bekommen, eine XML-Datei in eine STL-Datei umzuwandeln und soll ein eigenes Programm schreiben.<br />
Ich bin Maschinenbauer und besitzte leider rudimentäre Kenntnisse über C++ und wollte daher euch um Hilfe bitten(eine Schleife kann ich schon schreiben).</p>
<p>Ich hab mich schon über XML Parser schlau gemacht, sehe da aber leider nicht so durch.<br />
Könnt ihr mir bitte helfen oder mir den richtigen Weg weisen.<br />
Eine Dankeschön schon mal im vorraus.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/296340/datei-von-xml-zu-stl-mit-c</link><generator>RSS for Node</generator><lastBuildDate>Fri, 14 Aug 2026 12:01:09 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/296340.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 02 Dec 2011 20:09:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Datei von XML zu STL mit C++ on Fri, 02 Dec 2011 20:09:47 GMT]]></title><description><![CDATA[<p>Hallo Leute</p>
<p>Hab gerade in der Uni die Aufgabe bekommen, eine XML-Datei in eine STL-Datei umzuwandeln und soll ein eigenes Programm schreiben.<br />
Ich bin Maschinenbauer und besitzte leider rudimentäre Kenntnisse über C++ und wollte daher euch um Hilfe bitten(eine Schleife kann ich schon schreiben).</p>
<p>Ich hab mich schon über XML Parser schlau gemacht, sehe da aber leider nicht so durch.<br />
Könnt ihr mir bitte helfen oder mir den richtigen Weg weisen.<br />
Eine Dankeschön schon mal im vorraus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2152060</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2152060</guid><dc:creator><![CDATA[Juwe]]></dc:creator><pubDate>Fri, 02 Dec 2011 20:09:47 GMT</pubDate></item><item><title><![CDATA[Reply to Datei von XML zu STL mit C++ on Fri, 02 Dec 2011 20:12:01 GMT]]></title><description><![CDATA[<p>Das musst Du wohl ein wenig genauer Beschreiben, ich weiss nämlich nicht was eine <em>STL-Datei</em> sein soll.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2152062</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2152062</guid><dc:creator><![CDATA[theta]]></dc:creator><pubDate>Fri, 02 Dec 2011 20:12:01 GMT</pubDate></item><item><title><![CDATA[Reply to Datei von XML zu STL mit C++ on Fri, 02 Dec 2011 20:18:28 GMT]]></title><description><![CDATA[<p>Zur genaueren Beschreibung</p>
<p>Die XML-Datei ist eine Schiffssection, in der Platten, Löcher, Cutouts und noch einiges mehr drin stehen.</p>
<p>Die Daten beinhalten die Eckpunkte der Platten, erzeugt vektoren, um die Kontur darzustellen und daraufhin werden Löcher reingemacht oder etwas anderes drauf.</p>
<p>Die STL-Datei halbiert die Platten. Die stellt alles mit Dreiecken dar. Außerdem benötigt diese Datei viel weniger informationen, um die Schiffssection wieder darzustellen.</p>
<p>Ich glaube zwar nicht, dass ich deine Frage beantwortet habe. Wenn also nicht, bitte etwas genauer.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2152065</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2152065</guid><dc:creator><![CDATA[Juwe]]></dc:creator><pubDate>Fri, 02 Dec 2011 20:18:28 GMT</pubDate></item><item><title><![CDATA[Reply to Datei von XML zu STL mit C++ on Fri, 02 Dec 2011 20:30:31 GMT]]></title><description><![CDATA[<ol>
<li>Muss es unbedingt C++ sein? Ich denk mal, dass dir z.B. C# sehr viel leichter fallen würde. Dank .NET hättest du XML dort auch schon out of the box verfügbar.</li>
<li>Wo genau liegt jetzt dein Problem?</li>
</ol>
]]></description><link>https://www.c-plusplus.net/forum/post/2152070</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2152070</guid><dc:creator><![CDATA[dot]]></dc:creator><pubDate>Fri, 02 Dec 2011 20:30:31 GMT</pubDate></item><item><title><![CDATA[Reply to Datei von XML zu STL mit C++ on Fri, 02 Dec 2011 20:34:21 GMT]]></title><description><![CDATA[<p>Es muss nicht C++ sein. Nur mit dem Programm kenne ich mich am besten aus.<br />
Wenn du/ihr was besseres wisst, um das Problem besser und schneller zu lösen, dann bloß her damit.</p>
<p>Mein Problem:<br />
Ich weiß nicht, wie ich einem Programm sage: Nimm die Informationen raus(XML), die ich brauche und schreibe sie in ein STL-Format. Beim STL-Format könnte es auch sein, dass ich dem Programm den Quellcode vorgebe</p>
<p>ob das hilft, ist eine andere Frage, aber so ähnlich könnte das STL-Format am ende aussehen</p>
<p>solid plate<br />
facet normal nx1 ny1 nz1<br />
outer loop<br />
vertex x1 y1 z1<br />
vertex x2 y2 z2<br />
vertex x4 y4 z4<br />
endloop<br />
endfacet<br />
facet normal nx2 ny2 nz2<br />
outer loop<br />
vertex x2 y2 z2<br />
vertex x3 y3 z3<br />
vertex x4 y4 z4<br />
endloop<br />
endfacet<br />
endsolid plate</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2152073</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2152073</guid><dc:creator><![CDATA[Juwe]]></dc:creator><pubDate>Fri, 02 Dec 2011 20:34:21 GMT</pubDate></item><item><title><![CDATA[Reply to Datei von XML zu STL mit C++ on Fri, 02 Dec 2011 20:40:50 GMT]]></title><description><![CDATA[<p>Wie sieht denn das zu parsende XML aus?</p>
<p>Wieviel Programmiererfahrung hast du denn? Hast du überhaupt schonmal ein Programm geschrieben, das mit Dateien arbeitet!?<br />
Dass du C++ als &quot;Programm&quot; bezeichnest, würd ich mal als Zeichen dafür werten, dass du bei einer anderen Sprache besser aufgehoben wärst <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2152074</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2152074</guid><dc:creator><![CDATA[dot]]></dc:creator><pubDate>Fri, 02 Dec 2011 20:40:50 GMT</pubDate></item><item><title><![CDATA[Reply to Datei von XML zu STL mit C++ on Fri, 02 Dec 2011 20:45:33 GMT]]></title><description><![CDATA[<p>Das wäre eine einfach Platte</p>
<p>&lt;Ship Version=&quot;1.3&quot;&gt;<br />
&lt;Material Grade=&quot;Default&quot; Density=&quot;7840&quot; YoungsModulus=&quot;206000&quot; PoissonRatio=&quot;0.3&quot; YieldStress=&quot;220&quot; UltimateStress=&quot;360&quot;/&gt;&lt;Block ObjId=&quot;TRAIN0&quot;&gt;<br />
&lt;Extent&gt;<br />
&lt;Min X=&quot;-1.0000000000E000&quot; Y=&quot;-1.0000000000E000&quot; Z=&quot;-1.0000000000E000&quot;/&gt;<br />
&lt;Max X=&quot;1.0000000000E000&quot; Y=&quot;1.0000000000E000&quot; Z=&quot;1.0000000000E000&quot;/&gt;<br />
&lt;/Extent&gt;<br />
&lt;PlanePanel ObjId=&quot;TRAIN0-PLATE1&quot; DataType=&quot;101&quot; Instance=&quot;AsDefined&quot;&gt;&lt;Extent&gt;<br />
&lt;Min X=&quot;7.9200000000E004&quot; Y=&quot;2.5100000000E003&quot; Z=&quot;1.4000000000E003&quot;/&gt;<br />
&lt;Max X=&quot;7.9212000000E004&quot; Y=&quot;5.7100000000E003&quot; Z=&quot;2.8000000000E003&quot;/&gt;<br />
&lt;/Extent&gt;<br />
&lt;CoordSys&gt;<br />
&lt;Origin X=&quot;7.9200000000E004&quot; Y=&quot;0.0000000000E000&quot; Z=&quot;0.0000000000E000&quot;/&gt;<br />
&lt;Waxis X=&quot;1.0000000000E000&quot; Y=&quot;0.0000000000E000&quot; Z=&quot;0.0000000000E000&quot;/&gt;<br />
&lt;Uaxis X=&quot;0.0000000000E000&quot; Y=&quot;1.0000000000E000&quot; Z=&quot;0.0000000000E000&quot;/&gt;&lt;/CoordSys&gt;<br />
&lt;Boundary&gt;<br />
&lt;Limit CompId=&quot;1&quot;&gt;<br />
&lt;StartPoint2d U=&quot;2.5100000000E003&quot; V=&quot;2.8000000000E003&quot;/&gt;<br />
&lt;/Limit&gt;<br />
&lt;Limit CompId=&quot;2&quot;&gt;<br />
&lt;StartPoint2d U=&quot;2.5100000000E003&quot; V=&quot;1.4000000000E003&quot;/&gt;<br />
&lt;/Limit&gt;<br />
&lt;Limit CompId=&quot;3&quot;&gt;<br />
&lt;StartPoint2d U=&quot;5.7100000000E003&quot; V=&quot;1.4000000000E003&quot;/&gt;<br />
&lt;/Limit&gt;<br />
&lt;Limit CompId=&quot;4&quot;&gt;&lt;StartPoint2d U=&quot;5.7100000000E003&quot; V=&quot;2.8000000000E003&quot;/&gt;&lt;/Limit&gt;<br />
&lt;SimpleContour&gt;<br />
&lt;StartPoint2d U=&quot;2.5100000000E003&quot; V=&quot;2.8000000000E003&quot;/&gt;<br />
&lt;Segment2d&gt;<br />
&lt;Amplitude2d U=&quot;0.0000000000E000&quot; V=&quot;0.0000000000E000&quot;/&gt;<br />
&lt;Node2d U=&quot;2.5100000000E003&quot; V=&quot;1.4000000000E003&quot;/&gt;<br />
&lt;/Segment2d&gt;<br />
&lt;Segment2d&gt;<br />
&lt;Amplitude2d U=&quot;0.0000000000E000&quot; V=&quot;0.0000000000E000&quot;/&gt;<br />
&lt;Node2d U=&quot;5.7100000000E003&quot; V=&quot;1.4000000000E003&quot;/&gt;<br />
&lt;/Segment2d&gt;<br />
&lt;Segment2d&gt;<br />
&lt;Amplitude2d U=&quot;0.0000000000E000&quot; V=&quot;0.0000000000E000&quot;/&gt;<br />
&lt;Node2d U=&quot;5.7100000000E003&quot; V=&quot;2.8000000000E003&quot;/&gt;<br />
&lt;/Segment2d&gt;<br />
&lt;Segment2d&gt;<br />
&lt;Amplitude2d U=&quot;0.0000000000E000&quot; V=&quot;0.0000000000E000&quot;/&gt;<br />
&lt;Node2d U=&quot;2.5100000000E003&quot; V=&quot;2.8000000000E003&quot;/&gt;<br />
&lt;/Segment2d&gt;<br />
&lt;/SimpleContour&gt;<br />
&lt;DetailedContour&gt;<br />
&lt;StartPoint2d U=&quot;2.5100000000E003&quot; V=&quot;2.8000000000E003&quot;/&gt;<br />
&lt;Segment2d&gt;<br />
&lt;Amplitude2d U=&quot;0.0000000000E000&quot; V=&quot;0.0000000000E000&quot;/&gt;<br />
&lt;Node2d U=&quot;2.5100000000E003&quot; V=&quot;1.4000000000E003&quot;/&gt;<br />
&lt;/Segment2d&gt;<br />
&lt;Segment2d&gt;<br />
&lt;Amplitude2d U=&quot;0.0000000000E000&quot; V=&quot;0.0000000000E000&quot;/&gt;<br />
&lt;Node2d U=&quot;5.7100000000E003&quot; V=&quot;1.4000000000E003&quot;/&gt;<br />
&lt;/Segment2d&gt;<br />
&lt;Segment2d&gt;<br />
&lt;Amplitude2d U=&quot;0.0000000000E000&quot; V=&quot;0.0000000000E000&quot;/&gt;<br />
&lt;Node2d U=&quot;5.7100000000E003&quot; V=&quot;2.8000000000E003&quot;/&gt;<br />
&lt;/Segment2d&gt;<br />
&lt;Segment2d&gt;<br />
&lt;Amplitude2d U=&quot;0.0000000000E000&quot; V=&quot;0.0000000000E000&quot;/&gt;<br />
&lt;Node2d U=&quot;2.5100000000E003&quot; V=&quot;2.8000000000E003&quot;/&gt;<br />
&lt;/Segment2d&gt;<br />
&lt;/DetailedContour&gt;<br />
&lt;/Boundary&gt;<br />
&lt;PlateGroup GroupId=&quot;4&quot;&gt;<br />
&lt;Material Grade=&quot;Default&quot;&gt;<br />
&lt;Thickness&gt;12.0&lt;/Thickness&gt;<br />
&lt;/Material&gt;<br />
&lt;MaterialSide&gt;Forward&lt;/MaterialSide&gt;<br />
&lt;Plate CompId=&quot;1&quot;&gt;<br />
&lt;Limit&gt;<br />
&lt;ModelRef ObjType=&quot;PlanePanel&quot; ObjId=&quot;TRAIN0-PLATE1&quot; CompType=&quot;Limit&quot; CompId=&quot;1&quot;/&gt;<br />
&lt;StartPoint2d U=&quot;2.5100000000E003&quot; V=&quot;2.8000000000E003&quot;/&gt;<br />
&lt;/Limit&gt;<br />
&lt;Limit&gt;<br />
&lt;ModelRef ObjType=&quot;PlanePanel&quot; ObjId=&quot;TRAIN0-PLATE1&quot; CompType=&quot;Limit&quot; CompId=&quot;2&quot;/&gt;<br />
&lt;StartPoint2d U=&quot;2.5100000000E003&quot; V=&quot;1.4000000000E003&quot;/&gt;<br />
&lt;/Limit&gt;<br />
&lt;Limit&gt;<br />
&lt;ModelRef ObjType=&quot;PlanePanel&quot; ObjId=&quot;TRAIN0-PLATE1&quot; CompType=&quot;Limit&quot; CompId=&quot;3&quot;/&gt;<br />
&lt;StartPoint2d U=&quot;5.7100000000E003&quot; V=&quot;1.4000000000E003&quot;/&gt;<br />
&lt;/Limit&gt;<br />
&lt;Limit&gt;<br />
&lt;ModelRef ObjType=&quot;PlanePanel&quot; ObjId=&quot;TRAIN0-PLATE1&quot; CompType=&quot;Limit&quot; CompId=&quot;4&quot;/&gt;<br />
&lt;StartPoint2d U=&quot;5.7100000000E003&quot; V=&quot;2.8000000000E003&quot;/&gt;<br />
&lt;/Limit&gt;<br />
&lt;SimpleContour&gt;<br />
&lt;StartPoint2d U=&quot;2.5100000000E003&quot; V=&quot;2.8000000000E003&quot;/&gt;<br />
&lt;Segment2d&gt;<br />
&lt;Amplitude2d U=&quot;0.0000000000E000&quot; V=&quot;0.0000000000E000&quot;/&gt;<br />
&lt;Node2d U=&quot;2.5100000000E003&quot; V=&quot;1.4000000000E003&quot;/&gt;<br />
&lt;/Segment2d&gt;<br />
&lt;Segment2d&gt;<br />
&lt;Amplitude2d U=&quot;0.0000000000E000&quot; V=&quot;0.0000000000E000&quot;/&gt;<br />
&lt;Node2d U=&quot;5.7100000000E003&quot; V=&quot;1.4000000000E003&quot;/&gt;<br />
&lt;/Segment2d&gt;<br />
&lt;Segment2d&gt;<br />
&lt;Amplitude2d U=&quot;0.0000000000E000&quot; V=&quot;0.0000000000E000&quot;/&gt;<br />
&lt;Node2d U=&quot;5.7100000000E003&quot; V=&quot;2.8000000000E003&quot;/&gt;<br />
&lt;/Segment2d&gt;<br />
&lt;Segment2d&gt;<br />
&lt;Amplitude2d U=&quot;0.0000000000E000&quot; V=&quot;0.0000000000E000&quot;/&gt;<br />
&lt;Node2d U=&quot;2.5100000000E003&quot; V=&quot;2.8000000000E003&quot;/&gt;<br />
&lt;/Segment2d&gt;<br />
&lt;/SimpleContour&gt;<br />
&lt;DetailedContour&gt;<br />
&lt;StartPoint2d U=&quot;2.5100000000E003&quot; V=&quot;2.8000000000E003&quot;/&gt;<br />
&lt;Segment2d&gt;<br />
&lt;Amplitude2d U=&quot;0.0000000000E000&quot; V=&quot;0.0000000000E000&quot;/&gt;<br />
&lt;Node2d U=&quot;2.5100000000E003&quot; V=&quot;1.4000000000E003&quot;/&gt;<br />
&lt;/Segment2d&gt;<br />
&lt;Segment2d&gt;<br />
&lt;Amplitude2d U=&quot;0.0000000000E000&quot; V=&quot;0.0000000000E000&quot;/&gt;<br />
&lt;Node2d U=&quot;5.7100000000E003&quot; V=&quot;1.4000000000E003&quot;/&gt;<br />
&lt;/Segment2d&gt;<br />
&lt;Segment2d&gt;<br />
&lt;Amplitude2d U=&quot;0.0000000000E000&quot; V=&quot;0.0000000000E000&quot;/&gt;<br />
&lt;Node2d U=&quot;5.7100000000E003&quot; V=&quot;2.8000000000E003&quot;/&gt;<br />
&lt;/Segment2d&gt;<br />
&lt;Segment2d&gt;<br />
&lt;Amplitude2d U=&quot;0.0000000000E000&quot; V=&quot;0.0000000000E000&quot;/&gt;<br />
&lt;Node2d U=&quot;2.5100000000E003&quot; V=&quot;2.8000000000E003&quot;/&gt;<br />
&lt;/Segment2d&gt;<br />
&lt;/DetailedContour&gt;<br />
&lt;/Plate&gt;<br />
&lt;/PlateGroup&gt;<br />
&lt;/PlanePanel&gt;<br />
&lt;/Block&gt;<br />
&lt;/Ship&gt;</p>
<p>hat etwas länger gedauert, dass alles ordentlich aufzuschreiben</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2152077</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2152077</guid><dc:creator><![CDATA[Juwe]]></dc:creator><pubDate>Fri, 02 Dec 2011 20:45:33 GMT</pubDate></item><item><title><![CDATA[Reply to Datei von XML zu STL mit C++ on Fri, 02 Dec 2011 20:48:08 GMT]]></title><description><![CDATA[<p>Nein, ich hab noch nie ein Programm geschrieben, dass eine andere Datei einbezieht<br />
Für Ratschläge bin ich immer zu haben</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2152079</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2152079</guid><dc:creator><![CDATA[Juwe]]></dc:creator><pubDate>Fri, 02 Dec 2011 20:48:08 GMT</pubDate></item><item><title><![CDATA[Reply to Datei von XML zu STL mit C++ on Fri, 02 Dec 2011 21:01:46 GMT]]></title><description><![CDATA[<p>Naja, je nachdem wieviel Zeit du investieren kannst und willst, würd ich dir dazu raten, erstmal die Basics von C# zu lernen. Je nachdem wieviel Programmiererfahrung du schon hast, kann das eine Weile dauern. Auf jeden Fall solltest du zuerst in ein paar Übungsprogrammen den Umgang mit Dateien lernen.<br />
Wenn du nicht soviel Zeit hast, dann ist es vielleicht besser, einfach jemanden zu suchen, der dir das Programm macht (nachdem du Maschinenbauer bist, geh ich mal davon aus, dass es sich da nicht um eine Übungsaufgabe handelt).</p>
<p>Da du wohl sowieso noch nicht besonders viel Zeit in C++ investiert hast, würd ich davon eher abraten. Mit C# wirst du dein Ziel vermutlich sehr viel schneller und einfacher erreichen. Rein prinzipiell lässt sich dein Problem jedenfalls in jeder beliebigen general-purpose Programmiersprache lösen.</p>
<p>C# bekommst du hier: <a href="http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-csharp-express" rel="nofollow">http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-csharp-express</a><br />
Ein, dem Hörensagen nach, ganz brauchbares Buch gibts hier: <a href="http://openbook.galileocomputing.de/visual_csharp_2010/" rel="nofollow">http://openbook.galileocomputing.de/visual_csharp_2010/</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2152082</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2152082</guid><dc:creator><![CDATA[dot]]></dc:creator><pubDate>Fri, 02 Dec 2011 21:01:46 GMT</pubDate></item><item><title><![CDATA[Reply to Datei von XML zu STL mit C++ on Fri, 02 Dec 2011 21:01:04 GMT]]></title><description><![CDATA[<p>Ok, dann schlage ich dir den PugiXml Parser vor.<br />
(<a href="http://pugixml.org/" rel="nofollow">http://pugixml.org/</a>)</p>
<p>Dann gehts so:<br />
- XML File einlesen<br />
- Die interne Repräsentation des XML Files (=DOM) prozessieren<br />
- Daraus die STL Datei generieren</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2152083</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2152083</guid><dc:creator><![CDATA[theta]]></dc:creator><pubDate>Fri, 02 Dec 2011 21:01:04 GMT</pubDate></item><item><title><![CDATA[Reply to Datei von XML zu STL mit C++ on Fri, 02 Dec 2011 21:06:34 GMT]]></title><description><![CDATA[<p>Also eine Übungsaufgabe ist das nicht.</p>
<p>Wegen PugiXml. Ich schau mir das mal an.</p>
<p>=DOM prozessieren<br />
Was meinst du damit? So zusagen die relevanten Daten rausfiltern und aufschreiben.</p>
<p>Auch wenn ich kein Idiot bin, aber schreibt es mir doch bitte Idiotensicher auf.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2152086</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2152086</guid><dc:creator><![CDATA[Juwe]]></dc:creator><pubDate>Fri, 02 Dec 2011 21:06:34 GMT</pubDate></item><item><title><![CDATA[Reply to Datei von XML zu STL mit C++ on Fri, 02 Dec 2011 21:13:13 GMT]]></title><description><![CDATA[<blockquote>
<p>solid plate<br />
facet normal nx1 ny1 nz1<br />
outer loop<br />
vertex x1 y1 z1<br />
vertex x2 y2 z2<br />
vertex x4 y4 z4<br />
endloop<br />
endfacet<br />
facet normal nx2 ny2 nz2<br />
outer loop<br />
vertex x2 y2 z2<br />
vertex x3 y3 z3<br />
vertex x4 y4 z4<br />
endloop<br />
endfacet<br />
endsolid plate</p>
</blockquote>
<p>Wie sähe denn die dazugehörige XML Datei aus? Einen Zusammmenhang zu dem Beispiel das du gepostet hast, kann ich nicht erkennen.</p>
<p>Das wäre nämlich der erste Schritt: Überlege dir wie die generell von der XML Datei zur STL Datei kommen kannst. Wie wird z.B. ein <code>vertex</code> in der XML Datei repräsentiert? Wie ein <code>outer loop</code> ? Etc.</p>
<blockquote>
<p>=DOM prozessieren<br />
Was meinst du damit? So zusagen die relevanten Daten rausfiltern und aufschreiben.</p>
</blockquote>
<p>XML Parser erzeugen ein DOM - eine baumartige Repräsentation deiner XML Datei (siehe <a href="http://de.wikipedia.org/wiki/Document_Object_Model#Grundlagen_von_DOM_anhand_eines_Beispiels" rel="nofollow">hier</a>). Und mit diesem DOM kannst du dann arbeiten, z.B. indem du in einer Schleife durch alle &lt;Segment2d&gt; Knoten iterierst. Dabei hilft dir dann die XML Bibliothek deiner Wahl, in die du dich dann wohl oder übel einarbeiten musst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2152088</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2152088</guid><dc:creator><![CDATA[AndererMaschi]]></dc:creator><pubDate>Fri, 02 Dec 2011 21:13:13 GMT</pubDate></item><item><title><![CDATA[Reply to Datei von XML zu STL mit C++ on Fri, 02 Dec 2011 21:24:13 GMT]]></title><description><![CDATA[<p>Und gerade darum rate ich ihm zu C#. Denn er hat mit C++ sowieso noch praktisch keine Erfahrung wie es aussieht. Bis er also die XML Bibliothek am Laufen und sich eingearbeitet hat, könnte er wohl genausogut einfach C# lernen, wo das ganze dann imo sehr viel einfacher realisierbar ist. Vielleicht garnicht soviel einfacher was die Codemenge angeht, aber zumindest in einer Umgebung die nicht an jeder Ecke hunderte Fallstricke gespannt hat...</p>
<p>Ich würde auch mal meinen, dass ein DOM für das Problem hier nicht nötig ist. Ein einfacher XmlReader sollte imo völlig ausreichend sein.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2152091</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2152091</guid><dc:creator><![CDATA[dot]]></dc:creator><pubDate>Fri, 02 Dec 2011 21:24:13 GMT</pubDate></item><item><title><![CDATA[Reply to Datei von XML zu STL mit C++ on Fri, 02 Dec 2011 21:26:00 GMT]]></title><description><![CDATA[<p>Hier mal ein minimal Bsp. (voraussetzung ist, dass die drei PugiXml Files eingebunden sind).</p>
<p>Die Zuordnung von XML Elementen nach STL File habe ich geraten und liege wahrscheinlich daneben:</p>
<p>Es muss ein File Platte.xml mit dem XML Inhalt existieren, daraus wird eine Datei Platte.txt erzeugt.</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;fstream&gt;

#include &quot;pugixml.hpp&quot;

// STL file format (eg.)
// ==========================
// solid plate
// facet normal nx1 ny1 nz1
// outer loop
// vertex x1 y1 z1
// vertex x2 y2 z2
// vertex x4 y4 z4
// endloop
// endfacet
// facet normal nx2 ny2 nz2
// outer loop
// vertex x2 y2 z2
// vertex x3 y3 z3
// vertex x4 y4 z4
// endloop
// endfacet
// endsolid plate

int main()
{
    pugi::xml_document document;
    pugi::xml_parse_result result = document.load_file(&quot;Platte.xml&quot;);
    if (!result)
    {
        std::cerr &lt;&lt; &quot;Could not open XML file: &quot; &lt;&lt; result &lt;&lt; std::endl;
        return 1;
    }

    std::ofstream output(&quot;Platte.txt&quot;);
    if (!output)
    {
        std::cerr &lt;&lt; &quot;Could not open STL file.&quot; &lt;&lt; std::endl;
        return 1;
    }

    pugi::xml_node coordSysNode = document.select_single_node(&quot;Ship/Block/PlanePanel/CoordSys&quot;).node();

    pugi::xml_node originNode = coordSysNode.child(&quot;Origin&quot;);
    double originX = originNode.attribute(&quot;X&quot;).as_double();
    double originY = originNode.attribute(&quot;Y&quot;).as_double();
    double originZ = originNode.attribute(&quot;Z&quot;).as_double();
    output &lt;&lt; &quot;vertex &quot; &lt;&lt; originX &lt;&lt; &quot; &quot; &lt;&lt; originY &lt;&lt; &quot; &quot; &lt;&lt; originZ &lt;&lt; std::endl;

    pugi::xml_node waxisNode = coordSysNode.child(&quot;Waxis&quot;);
    double waxisX = waxisNode.attribute(&quot;X&quot;).as_double();
    double waxisY = waxisNode.attribute(&quot;Y&quot;).as_double();
    double waxisZ = waxisNode.attribute(&quot;Z&quot;).as_double();
    output &lt;&lt; &quot;vertex &quot; &lt;&lt; waxisX &lt;&lt; &quot; &quot; &lt;&lt; waxisY &lt;&lt; &quot; &quot; &lt;&lt; waxisZ &lt;&lt; std::endl;

    pugi::xml_node uaxisNode = coordSysNode.child(&quot;Uaxis&quot;);
    double uaxisX = uaxisNode.attribute(&quot;X&quot;).as_double();
    double uaxisY = uaxisNode.attribute(&quot;Y&quot;).as_double();
    double uaxisZ = uaxisNode.attribute(&quot;Z&quot;).as_double();
    output &lt;&lt; &quot;vertex &quot; &lt;&lt; uaxisX &lt;&lt; &quot; &quot; &lt;&lt; uaxisY &lt;&lt; &quot; &quot; &lt;&lt; uaxisZ &lt;&lt; std::endl;

    return 0;
}
</code></pre>
<p>Edit:<br />
Die 3 PugiXMml Files wären: pugiconfig.hpp, pugixml.hpp, pugixml.cpp</p>
<p>Anmerkung:<br />
Im File Platte.txt steht anschliessend:</p>
<pre><code>vertex 79200 0 0
vertex 1 0 0
vertex 0 1 0
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2152092</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2152092</guid><dc:creator><![CDATA[theta]]></dc:creator><pubDate>Fri, 02 Dec 2011 21:26:00 GMT</pubDate></item><item><title><![CDATA[Reply to Datei von XML zu STL mit C++ on Fri, 02 Dec 2011 21:30:39 GMT]]></title><description><![CDATA[<p>Hey Leute</p>
<p>Ich werd grad etwas überschlagen von Fragen und Antworten.<br />
Das von theta werd ich erstmal probieren.</p>
<p>Wenn ansonsten C# so empfohlen wird, könnte ich es auch auf diese Weise versuchen. Erstmal danke.</p>
<p>Ich meld mich ansonsten später nochmal</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2152095</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2152095</guid><dc:creator><![CDATA[Juwe]]></dc:creator><pubDate>Fri, 02 Dec 2011 21:30:39 GMT</pubDate></item><item><title><![CDATA[Reply to Datei von XML zu STL mit C++ on Fri, 02 Dec 2011 21:51:01 GMT]]></title><description><![CDATA[<p>Hey theta</p>
<p>das ding hat ja sogar bei mir funktioniert. Echt super. Muss mal sehn, dass ich den Code nun weiterschreibe, damit auch der Rest der Informationen gespeichert werden können.</p>
<p>Aber schonmal vielen Dank, natürlich auch an dot.</p>
<p>Schön Abend euch noch</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2152103</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2152103</guid><dc:creator><![CDATA[Juwe]]></dc:creator><pubDate>Fri, 02 Dec 2011 21:51:01 GMT</pubDate></item><item><title><![CDATA[Reply to Datei von XML zu STL mit C++ on Mon, 12 Dec 2011 13:37:04 GMT]]></title><description><![CDATA[<p>Hallo.</p>
<p>Ich hätte noch zwei Fragen wegen meinem Thema</p>
<p>Und zwar ist meine XML-Datei Ebenenbasiert:</p>
<p>Also<br />
-Ship<br />
-Block<br />
-PlanePanel<br />
-Boundary<br />
-Limit</p>
<p>Da es nun weiteres Limits gibt, in dem Punkte gespeichert sind, kann mir bitte jemand sagen, wie ich dem Programm sage, dass er das zweite, dritte, vierte Limit auswählen soll?</p>
<p>der Code von C++</p>
<p>pugi::xml_node coordSysNode2 = document.select_single_node(&quot;Ship/Block/PlanePanel/Boundary/Limit&quot;).node();</p>
<p>pugi::xml_node originNode2 = coordSysNode2.child(&quot;StartPoint2d&quot;);<br />
double U = originNode2.attribute(&quot;U&quot;).as_double();<br />
double V = originNode2.attribute(&quot;V&quot;).as_double();<br />
output &lt;&lt; &quot;U/V &quot; &lt;&lt; U &lt;&lt; &quot; &quot; &lt;&lt; V &lt;&lt; std::endl;</p>
<p>die XML-Datei</p>
<p>&lt;Boundary&gt;<br />
&lt;Limit CompId=&quot;1&quot;&gt;<br />
&lt;StartPoint2d U=&quot;2.5100000000E003&quot; V=&quot;2.8000000000E003&quot;/&gt;<br />
&lt;/Limit&gt;<br />
&lt;Limit CompId=&quot;2&quot;&gt;<br />
&lt;StartPoint2d U=&quot;2.5100000000E003&quot; V=&quot;1.4000000000E003&quot;/&gt;<br />
&lt;/Limit&gt;<br />
&lt;Limit CompId=&quot;3&quot;&gt;<br />
&lt;StartPoint2d U=&quot;5.7100000000E003&quot; V=&quot;1.4000000000E003&quot;/&gt;<br />
&lt;/Limit&gt;<br />
&lt;Limit CompId=&quot;4&quot;&gt;&lt;StartPoint2d U=&quot;5.7100000000E003&quot; V=&quot;2.8000000000E003&quot;/&gt;</p>
<p>hoffe, ihr könnt mir helfen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2156145</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2156145</guid><dc:creator><![CDATA[Juwe]]></dc:creator><pubDate>Mon, 12 Dec 2011 13:37:04 GMT</pubDate></item><item><title><![CDATA[Reply to Datei von XML zu STL mit C++ on Mon, 12 Dec 2011 15:36:04 GMT]]></title><description><![CDATA[<p>Ich kenne PugiXml nicht, aber schau dir mal das Beispiel hier an: <a href="http://pugixml.googlecode.com/svn/tags/latest/docs/manual/xpath.html#manual.xpath.select" rel="nofollow">http://pugixml.googlecode.com/svn/tags/latest/docs/manual/xpath.html#manual.xpath.select</a></p>
<p><code>select_nodes</code> scheint das zu sein was du suchst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2156181</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2156181</guid><dc:creator><![CDATA[comonad]]></dc:creator><pubDate>Mon, 12 Dec 2011 15:36:04 GMT</pubDate></item><item><title><![CDATA[Reply to Datei von XML zu STL mit C++ on Mon, 12 Dec 2011 18:09:18 GMT]]></title><description><![CDATA[<p>Danke für die Antwort.<br />
Jedoch ist mir diese Beschreibung zu speziell/kompliziert.<br />
Ich würde mich freuen, wenn mir jemand ein Beispiel aufschreiben würde.</p>
<p>Es dann auf meine Bedürfnisse umzuschreiben ist dann das geringste Problem</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2156244</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2156244</guid><dc:creator><![CDATA[Juwe]]></dc:creator><pubDate>Mon, 12 Dec 2011 18:09:18 GMT</pubDate></item><item><title><![CDATA[Reply to Datei von XML zu STL mit C++ on Mon, 12 Dec 2011 19:04:35 GMT]]></title><description><![CDATA[<p>Komm schon, du musst doch in der Lage sein folgenden Code auf dein Problem zuzuschneiden:</p>
<pre><code class="language-cpp">pugi::xpath_node_set tools = doc.select_nodes(&quot;/Profile/Tools/Tool[@AllowRemote='true' and @DeriveCaptionFrom='lastparam']&quot;);

std::cout &lt;&lt; &quot;Tools:&quot;;

for (pugi::xpath_node_set::const_iterator it = tools.begin(); it != tools.end(); ++it)
{
    pugi::xpath_node node = *it;
    std::cout &lt;&lt; &quot; &quot; &lt;&lt; node.node().attribute(&quot;Filename&quot;).value();
}

pugi::xpath_node build_tool = doc.select_single_node(&quot;//Tool[contains(Description, 'build system')]&quot;);

std::cout &lt;&lt; &quot;\nBuild tool: &quot; &lt;&lt; build_tool.node().attribute(&quot;Filename&quot;).value() &lt;&lt; &quot;\n&quot;;
</code></pre>
<p>Hier mal ein bisschen für dich umgeschrieben, damit klarer wird wie das mit deinem Problem zusammenhängt:</p>
<pre><code class="language-cpp">pugi::xpath_node_set tools = doc.select_nodes(&quot;Ship/Block/PlanePanel/Boundary/Limit&quot;);

for (pugi::xpath_node_set::const_iterator it = tools.begin(); it != tools.end(); ++it)
{
    pugi::xpath_node limit_node = *it;
    // Hier muss jetzt das hin, was du mit dem &lt;Limit ...&gt; Knoten (limit_node) machen möchtest. 
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2156271</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2156271</guid><dc:creator><![CDATA[comonad]]></dc:creator><pubDate>Mon, 12 Dec 2011 19:04:35 GMT</pubDate></item><item><title><![CDATA[Reply to Datei von XML zu STL mit C++ on Tue, 13 Dec 2011 17:05:39 GMT]]></title><description><![CDATA[<p>Hey Leute</p>
<p>Erstmal danke an Comonad.<br />
Ich sitz immernoch an meinem Programm fest.</p>
<p>Hab zur Zeit es hinbekommen, dass die Schleife nur bis zu einem bestimmten Punkt arbeitet, jedoch bekomm ich das einlesen der Punkte nicht hin.</p>
<p>Könnt ihr mir da vielleich auf die Sprünge helfen, was falsch ist?</p>
<p>das System sieht so aus (XML)</p>
<p>&lt;Boundary&gt;<br />
&lt;Limit CompId=&quot;1&quot;&gt;<br />
&lt;StartPoint2d U=&quot;2.5100000000E003&quot; V=&quot;2.8000000000E003&quot;/&gt;<br />
&lt;/Limit&gt;<br />
&lt;Limit CompId=&quot;2&quot;&gt;<br />
&lt;StartPoint2d U=&quot;2.5100000000E003&quot; V=&quot;1.4000000000E003&quot;/&gt;<br />
&lt;/Limit&gt;<br />
&lt;Limit CompId=&quot;3&quot;&gt;<br />
&lt;StartPoint2d U=&quot;5.7100000000E003&quot; V=&quot;1.4000000000E003&quot;/&gt;<br />
&lt;/Limit&gt;<br />
&lt;Limit CompId=&quot;4&quot;&gt;&lt;StartPoint2d U=&quot;5.7100000000E003&quot; V=&quot;2.8000000000E003&quot;/&gt;</p>
<p>der anfang lautet<br />
----------------------------------------------------------------------------<br />
pugi::xpath_node_set tools = document.select_nodes(&quot;Ship/Block/PlanePanel/Boundary/Limit/StartPoint2d&quot;);</p>
<p>for (pugi::xpath_node_set::const_iterator it = tools.begin(); it != tools.end(); ++it)<br />
{<br />
pugi::xpath_node limit_node = *it;<br />
double U = tools.attribute(&quot;U&quot;).as_double();<br />
output &lt;&lt; &quot;vertex &quot; &lt;&lt; U &lt;&lt; std::endl;<br />
}<br />
----------------------------------------------------------------------------</p>
<p>oder</p>
<p>----------------------------------------------------------------------------<br />
pugi::xpath_node_set tools = document.select_nodes(&quot;Ship/Block/PlanePanel/Boundary/Limit&quot;);</p>
<p>for (pugi::xpath_node_set::const_iterator it = tools.begin(); it != tools.end(); ++it)<br />
{<br />
pugi::xpath_node limit_node = *it;<br />
pugi::xpath_node originNode2 = tools.child(&quot;StartPoint2d&quot;);<br />
double U = originNode2.attribute(&quot;U&quot;).as_double();<br />
output &lt;&lt; &quot;vertex &quot; &lt;&lt; U &lt;&lt; std::endl;<br />
}<br />
----------------------------------------------------------------------------</p>
<p>ich weiß leider nicht genau, wie ich das definier muss, damit die Punkte eingelesen werden können.<br />
Hoffe ihr könnt mir helfen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2156595</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2156595</guid><dc:creator><![CDATA[Juwe]]></dc:creator><pubDate>Tue, 13 Dec 2011 17:05:39 GMT</pubDate></item><item><title><![CDATA[Reply to Datei von XML zu STL mit C++ on Tue, 13 Dec 2011 17:20:43 GMT]]></title><description><![CDATA[<p>Tut mir leid, Juwe, aber so wird das nichts.<br />
Deine Fragen zeigen, dass du den Beispielcode nur ansatzweise verstehst. Bevor du weitermachst, kauf dir ein gutes C++ Buch (z.B. den C++ Primer oder &quot;Der C++ Programmierer&quot;), ansonsten kommst du einfach nicht weiter. Wenn du dich mal in die Grundlagen eingelesen hast, wird das Verstehen des Quelltextes kein Problem mehr sein.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2156601</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2156601</guid><dc:creator><![CDATA[comonad]]></dc:creator><pubDate>Tue, 13 Dec 2011 17:20:43 GMT</pubDate></item><item><title><![CDATA[Reply to Datei von XML zu STL mit C++ on Fri, 16 Dec 2011 14:54:49 GMT]]></title><description><![CDATA[<p>Hey Leute</p>
<p>Ich komm gerade nicht weiter und hoffe, dass ihr mir einen Tipp geben könnt.</p>
<p>So sieht mein Code aus</p>
<p>cout &lt;&lt; &quot;\nX=: &quot; &lt;&lt; node.node().attribute(&quot;X&quot;).value();</p>
<p>und gibt mir aus<br />
X=: 7.650000 E003<br />
X=: 0.000000 E000<br />
usw.</p>
<p>jedoch kann ich den Wert nicht vergleichen lassen.<br />
so in etwa</p>
<p>if(node.node().attribute(&quot;X&quot;).value()&gt;0)<br />
{}</p>
<p>das funktiert leider nicht und ich hab auch schon versucht den Wert zu übergeben<br />
int o;<br />
o=*node.node().attribute(&quot;X&quot;).value();</p>
<p>leider auch ohne den gewünschten erfolg.</p>
<p>Kann mir mal bitte jemand sagen, wie ich das schreiben kann, damit ich den Wert richtig übergebe und somit vergleichen kann?</p>
<p>Danke schonmal im vorraus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2157754</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2157754</guid><dc:creator><![CDATA[Juwe]]></dc:creator><pubDate>Fri, 16 Dec 2011 14:54:49 GMT</pubDate></item><item><title><![CDATA[Reply to Datei von XML zu STL mit C++ on Fri, 16 Dec 2011 15:22:22 GMT]]></title><description><![CDATA[<p>Hat sich erledigt, hab einen Weg gefunden</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2157768</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2157768</guid><dc:creator><![CDATA[Juwe]]></dc:creator><pubDate>Fri, 16 Dec 2011 15:22:22 GMT</pubDate></item><item><title><![CDATA[Reply to Datei von XML zu STL mit C++ on Thu, 22 Dec 2011 14:45:09 GMT]]></title><description><![CDATA[<p>Hey Leute.</p>
<p>Ich hoffe ihr könnt mir mit eurer Erfahrung helfen.<br />
Hab ein Programm geschrieben, dass Punkte aus einer Datei raussucht und in ein .txt file speichert.</p>
<p>Mein Problem ist nun, dass das Programm bis zu über 100 Punkte ordentlich macht und dann auf einmal Fehler macht, obwohl er immernoch das selbe macht.<br />
Vllt hab ich ja einen Fehler bei der Definition der Variablen gemacht.<br />
Weiß vielleicht einer von euch, woran das liegen könnte???</p>
<p>Ich kann euch auch den Code schreiben, aber ist halt etwas länger.<br />
Danke schon mal</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2160160</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2160160</guid><dc:creator><![CDATA[Juwe]]></dc:creator><pubDate>Thu, 22 Dec 2011 14:45:09 GMT</pubDate></item><item><title><![CDATA[Reply to Datei von XML zu STL mit C++ on Thu, 22 Dec 2011 16:54:41 GMT]]></title><description><![CDATA[<p>Was für eine Art Fehler ist es denn? Hast du schonmal versucht den Fehler mit Hilfe eines Debuggers zu lokalisieren?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2160196</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2160196</guid><dc:creator><![CDATA[comonad]]></dc:creator><pubDate>Thu, 22 Dec 2011 16:54:41 GMT</pubDate></item></channel></rss>