How to convert files from Catia v5 into Babylon.js format? - babylonjs

I have a supplier using WebGL to create a 3D application for me. He requested the data in Babylon.js format. However, I only have the data in Catia v5 format. Which version should I provide the data in to allow for a conversion to Babylon? And, how could I convert from Catia v5 to Babylon.js?

There is no direct convertor from CATIA V5 or CATIA V6 (no mater the release) to Babylon.js. What you can do is to ask your supplier if he can use a neutral format like igs or stp, both CATIA versions can export those formats.

Related

R import excel without affecting format

I am looking for importing a database into R Studio without having the sentences been compacted in one line, can someone help?
Example:
In a single excel cells I have the following:
She went on holiday
He decided to eat an apple
Whereas in R Studio when I import the database I get:
She went on holiday He decided to eat an apple
The code I am using for importing is:
df <- as.data.frame(read_excel("/mypath.xlsx"))
What I have and would like to keep the format on R:

How can I read a semi-colon delimited log file in R?

I am currently working with a raw data set that, when downloaded from our device, outputs in a log file with values delimited with a semi-colon.
I am simply trying to load this data into r so I can put it onto a dataframe and analyze from there. However, as it is a log file I can't use read_csv or read_delim. When I use read_log, there is no input where I can define the delimiter, and as such my columns are being misread and I am receiving error messages since r is not recognizing ; as a delimiter in the file.
I have been unable to find any other instances of people using delimited log files with r, but I am trying to make the code work before I resign to uploading it into excel (I don't want to do this, both because the files have a lot of associated data and my computer runs excel very slowly). Does anyone have any suggestions of functions I could use to load the semi-colon delimited log file?
Thank you!
You could use data.table::fread(). freadautomatically recognizes most delimiters very reliable and reads most file types like *.csv, *.txt etc.
If your facing a situation where it doesn't guess the right delimiter, you can define it by setting the optionfread(your_file, sep=";"). But it won't be necessary in your case.
I've creates a file named your_file without any extension and the following content:
Text1;Text2;Text3;Text4
And now imported it to R:
library(data.table)
df = fread("your_file", header=FALSE)
Output:
> df
V1 V2 V3 V4
1: Text1 Text2 Text3 Text4

RE: Importing awkward dataset to R

I have some csv datasets (so-called DATRAS "exchange data" from ICES) which are in an unusual format making it a challenge to efficiently import them to my R workspace.
The files are laid out like so:
V1 V2 V3 ... V60
................
................
................
V2.1 V2.2 V2.3 ... V2.27
........................
........................
V3.1 V3.2 V3.3 ... V3.27
........................
........................
So, the issue is two-fold: there are three sets of (related) data stacked on top of one another in the csv file which I wish to be able to import as three separate objects in R; and these datasets have different dimensions and colnames.
So far, I have been using count.fields() on the files in the directory to identify the boundaries between each dataset, the readLines() to read the entire file as a character string for each row of data, then finally subsetting these chaacter strings acording to the values derived with count.fields().
Are there any more direct methods? I feel like the approach I am currently using is quite inelegant. It should be noted that these are large csv files.

Can I recreate a jpeg from a vector with class "raw"?

I've been able to use an API to download a file to R...sort of. I download the file and receive a vector of class "raw", but what I would like to do is write that vector out to a file in a manner that recreates the file as it was uploaded to my site.
In the sample vector below, I have a jpeg that I would like to save to a file. However, the solution needs to be more arbitrary, as pretty much any type of file could be downloaded via the API.
The vector I'm working with is rather large, so I'm linking to it.
I suppose you could use whatever file name you want, but the file name as downloaded from the site can be accessed using
gsub("\"", "", attributes(file)$'Content-Type'[2])
My initial thought was to convert the raw to bits using rawToBits but I can't seem to recreate the jpeg from there. Any tips or suggestions?
Figured it out on trial and error.
writeBin(as.vector(file),
gsub("\"", "", attributes(file)$'Content-Type'[2]),
useBytes=TRUE)

dxf to pdf in asp.net

Do you know a library that can convert a dxf file to pdf without having the autocad program installed ?
I'm looking to convert microsoft document too, but i know I can use the microsoft dll installed when you have office
Thanks
QCAD v3 has an utility called dwg2pdf which also can convert from dxf files. But the dwg/dxf importer requires a (reasonable priced) licence.
Inkscape has a command line option to convert to pdf. But currently it seems to have bug. It opens a confirmation popup even in no gui mode.
libreOffice can also convert dxf to pdf, but the result is not satisfying. The old oo convert via unoconv did yield better result.
There are other windows only solution I don't have experience with.

Resources